TCHGirl
asked on
Subset
I have a drop down box called race and in this box is the following
Asian
Black
Caucasian
Hispanic or Latino-------------------- >White
Middle Eastern Black/African American
Nat. American/Nat. Alaskan Asian
Native Hawaiian Etc
Multi-Racial
Pacific Islander
What I would like to do is if somebody selects Hispanic or Latino it then shows another list to select from.
I am not sure if I am saying this correctly so I hope this makes sense.
Asian
Black
Caucasian
Hispanic or Latino--------------------
Middle Eastern Black/African American
Nat. American/Nat. Alaskan Asian
Native Hawaiian Etc
Multi-Racial
Pacific Islander
What I would like to do is if somebody selects Hispanic or Latino it then shows another list to select from.
I am not sure if I am saying this correctly so I hope this makes sense.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here is the code that I use:
<td class="box">
Race:<br><select name="race">
<option value=""></option>
<option value="Asian" <%if rs.state <> 0 and not rs.eof and race = "Asian" then response.write "selected" end if%>>Asian</option>
<option value="Black" <%if rs.state <> 0 and not rs.eof and race = "Black" then response.write "selected" end if%>>Black</option>
<option value="Caucasian" <%if rs.state <> 0 and not rs.eof and race= "Caucasian" then response.write "selected" end if%>>Caucasian</option>
<option value="Hispanic or Latino" <%if rs.state <> 0 and not rs.eof and race = "Hispanic or Latino" then response.write "selected" end if%>>Hispanic or Latino</option>
<option value="Unknown" <%if rs.state <> 0 and not rs.eof and race = "Unknown" then response.write "selected" end if%>>Unknown</option>
</select>
</td>
So would I still use the above it my code looks like this? Or how would I change it?
<td class="box">
Race:<br><select name="race">
<option value=""></option>
<option value="Asian" <%if rs.state <> 0 and not rs.eof and race = "Asian" then response.write "selected" end if%>>Asian</option>
<option value="Black" <%if rs.state <> 0 and not rs.eof and race = "Black" then response.write "selected" end if%>>Black</option>
<option value="Caucasian" <%if rs.state <> 0 and not rs.eof and race= "Caucasian" then response.write "selected" end if%>>Caucasian</option>
<option value="Hispanic or Latino" <%if rs.state <> 0 and not rs.eof and race = "Hispanic or Latino" then response.write "selected" end if%>>Hispanic or Latino</option>
<option value="Unknown" <%if rs.state <> 0 and not rs.eof and race = "Unknown" then response.write "selected" end if%>>Unknown</option>
</select>
</td>
So would I still use the above it my code looks like this? Or how would I change it?
Not sure which suggestion you are responding to.
You can use my javascript suggestion with that markup. The critical thing in making my sample code work is to make sure the id of the subset drop down matches the option's value in the first drop down.
Example: If you have a option in the first drop down with value="Black" then the subset drop down will be <select id="Black" style="display:none">
You can use my javascript suggestion with that markup. The critical thing in making my sample code work is to make sure the id of the subset drop down matches the option's value in the first drop down.
Example: If you have a option in the first drop down with value="Black" then the subset drop down will be <select id="Black" style="display:none">
http://www.raymondcamden.com/index.cfm/2011/5/5/Related-selects-in-jQuery--an-example
good luck ...