Home > Archive > ASP > November 2005 > Fill Combo Box based on another Combo Box
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Fill Combo Box based on another Combo Box
|
|
| dthmtlgod 2005-11-16, 6:55 pm |
| I have a form on my webpage.
There are many comboboxes. One of them is where a user can select a
"State".
Based on the state, I want to select a "County". The form should populate
only the counties that apply to that State
I know how to do the JOIN if needed, but not quite sure how to pass the
value of the "State" combobox to the query that will be populating "County"
SELECT County
FROM Census
WHERE County = (value of the combobox "State")
Here is the code from the combobox "State"
<td><strong>Jurisdiction:</strong></td>
<td><select style="width: 50px;" name="State">
<option></option>
<%
While NOT RS2.EOF
%>
<option value="<%=RS2(0)%>"><%=RS2(0)%></option>
<%
RS2.MoveNext
WEND
%>
Thanks in advance
| |
| Bob Barrows [MVP] 2005-11-16, 6:55 pm |
| dthmtlgod wrote:
> I have a form on my webpage.
>
> There are many comboboxes. One of them is where a user can select a
> "State".
> Based on the state, I want to select a "County". The form should
> populate only the counties that apply to that State
>
http://www.aspfaq.com/show.asp?id=2270
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
|
|
|
|
|