Fill Combo Box based on another Combo Box

Discussion in 'ASP General' started by dthmtlgod, Nov 16, 2005.

  1. dthmtlgod

    dthmtlgod Guest

    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
    dthmtlgod, Nov 16, 2005
    #1
    1. Advertising

  2. 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.
    Bob Barrows [MVP], Nov 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hangar18
    Replies:
    0
    Views:
    130
    hangar18
    Mar 22, 2006
  2. Eugene Anthony

    fill combo box with data from database

    Eugene Anthony, Jul 14, 2005, in forum: ASP General
    Replies:
    4
    Views:
    139
    Bob Barrows [MVP]
    Jul 14, 2005
  3. Bob Bedford
    Replies:
    0
    Views:
    75
    Bob Bedford
    Dec 4, 2003
  4. RelaxoRy
    Replies:
    1
    Views:
    118
    Geoff Tucker
    Feb 25, 2004
  5. SM
    Replies:
    2
    Views:
    364
Loading...

Share This Page