Forums
This topic is locked
Dynamic Dropdown Boo Boos
Posted 29 Jun 2002 08:35:24
1
has voted
29 Jun 2002 08:35:24 aegis kleais posted:
Ok, this'll take a bit to explain, but here goes.They way I make dynamic dropdowns is like such:
Recordset1: rcdUsers (SELECT fldName FROM tblUsers ORDER BY fldName ASC)
Recordset2: rcdUserValue (SELECT fldName FROM tbLUsers ORDER BY fldName ASC)
Then I open up an ASP page and inset a dropdow box. I change the values to:
LABEL:
<%=(rcdUsers.Fields.Item("fldName".value)%>
VALUE:
<%=(rcdUsersValue.Fields.Item("fldName".value)%>
And I get a dropdown list that's populated with all the names, and it's even alphabetically sorted (this also makes sure that since both are in essence, the same recordset, that there is no mismatch in label to value). Sounds successfuly, but I took a look at my server behaviour and I have a ! by Dynamic List/Menu (menuName). So I assume I did something wrong.
Here's the kicker. I'm using these populated dropdown boxes to search engines. I have 3 search components right now:
frmName - textbox
frmType - dropdown box
frmLocation - dynamic dropdown box (populated in the manner I spoke of above)
The recordset that holds the returned results uses the following SQL Query:
SELECT * FROM tblRegions WHERE fldName LIKE '%MM_name%' AND fldType LIKE '%MM_type%' AND fldLocation LIKE '%MM_location%'
Here I type just "hel" into the frmName box and search I get:
hello | good
hello | bad
ok. When I type "hel" into the frmName box and select 'good' from the static frmType dropdown I get back:
hello | good
Great. So last, but not least is the implement and make sure that the frmLocation, a dynamically populated dropdown list, works right.
So I type "hel" into the frmName, select "any" and select "florida" from the frmLocation. And I do a search (which btw, I'm using the GET method so I can see the values passed in the URL)
And I get back:
hello | good | alaska
Alaska? That's the FIRST record in the rcdUserValue recordset. Why would it return Alaska when I entered 'Florida' ??? The SQL should equiv to '%Florida%', but I noticed something in the URL. The frmLocation was indeed ALASKA. No matter what I selected the dynamic dropdown to, it was always giving the first record back.
Is this cause UD shows my List/Menu with the ! ??? I thought that this was how to do dynamic dropdowns. Well, this is a bit of a doozy, but if someone could shed some light, I'd appreciate it much
Replies
Replied 29 Jun 2002 08:44:08
29 Jun 2002 08:44:08 aegis kleais replied:
Nevermind. Dang I'm fast at finding answers!
I only need 1 recordset to make a DD box. I call 2 fields from it, set the label to one and the value to the other.
I only need 1 recordset to make a DD box. I call 2 fields from it, set the label to one and the value to the other.