469,586 Members | 2,185 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,586 developers. It's quick & easy.

Fill Combo Box based on another Combo Box

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

Nov 22 '05 #1
1 7243
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.
Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Sherwood Botsford | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.