Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cutting off options in a drop down 1

Status
Not open for further replies.

crystalized

Programmer
Jul 10, 2000
390
CA
I have a search form that creates two dropdown lists from recordsets (used to allow search refinements). When I execute the search my results come back very quickly in IE but after I execute the search I find my dropdown lists each have only the first recordset option added to them.

So originally I have 3 options in the first dropdown and 26 in the second dropdown (one option in each is a "select one" option). In order to populate the dropdowns I simply loop through the recordsets and add options for each record in the recordset. The following is an example:
Code:
<select id=&quot;cmbProv&quot; name=&quot;cmbProv&quot;>
				<option Value=&quot;99&quot;>Select One</option>
			<%
			dim currProv
			do while not rcsProvList.EOF
				currProv=txtProv.value
			%>
				<option value=&quot;<%=currProv%>&quot;><%=currProv%></option>
			<%
				rcsProvList.moveNext
			loop
			%>
			</select>
In essence the page just calls itself again, with the selected and entered values as a querystring.

But after the search I have 1 recordset provided option in the first dropdown and 1 recordset provided option in the second dropdown. So it seems like it is not looping through the recordsets again.

Is the solution to this problem something that should be blatantly obvious to me?


Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
what's txtProv?

--Will Duty
wduty@radicalfringe.com

 
Oh sorry, I kind of cheat using hidden dtc's which are available in Interdev. I have a hidden text field that is bound to the prov recordset so as I loop through the province recordset the text field contains the current value which I then utilize the value of.


Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
You could try doing it directly and see if that works. I can't see the rest of your code but I'm guessing something like:


<%do while not rcsProvList.EOF
currProv=rcsProvList(&quot;fieldname&quot;)
%>
<option value=&quot;<%=currProv%>&quot;><%=currProv%></option>
<%
rcsProvList.moveNext
loop%>


--Will Duty
wduty@radicalfringe.com

 
Actually today I can not reproduce the behaviour I wrote of yesterday, so I guess I am okay. I know yesterday Interdev crashed a couple of times on me so maybe in the end the problem was related to that.

Thanks for the advice though.
Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top