Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Fill Combo Box based on another Combo Box

Reply
Thread Tools

Fill Combo Box based on another Combo Box

 
 
dthmtlgod
Guest
Posts: n/a
 
      11-16-2005
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



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      11-16-2005
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to reference one combo box from another combo box SM Javascript 2 04-28-2007 04:49 PM
Datagrid View - Displaying values in one combo based on selected value of another hangar18 ASP .Net Datagrid Control 0 03-22-2006 03:17 PM
fill combo box with data from database Eugene Anthony ASP General 4 07-14-2005 02:58 PM
Dynamically Fill and Format a texfield box based on 2 other filled texfield boxes RelaxoRy Javascript 1 02-25-2004 05:34 PM
Fill combo after selecting a value in a text edit Bob Bedford Javascript 0 12-04-2003 11:02 AM



Advertisments