Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

interconnected pull down menu?

Status
Not open for further replies.

peach255

Programmer
Jan 20, 2003
29
US
I have 2 pull down menus called "dept" and "discipline". I want the discipline pull down menu values to be dependent on the chosen values of the "dept". For ex., if dept=PRCL, then values for discipline= ACH, GEN, if dept=DISC, the discipline=CHM, and all else discipline=GEN .
I don't know how to write the syntax for this. This is what I have so far, which did not work, but instead display all of the values.
<select name=&quot;discipline&quot; id=&quot;discipline&quot;>
if document.all.dept.value=&quot;PRCL&quot; then
<option value = &quot;ACH&quot;>ACH</option>
<option value = &quot;GEN&quot;>GEN</option>
elseif document.all.dept.value= &quot;DISC&quot; then
<option value = &quot;CHM&quot;>CHM</option>
else
<option value = &quot;GEN&quot;>GEN</option>
</select>

Thanks!
 
Peach,

Have you considered this route:
faq216-3350

Worked like gangbusters for my application!

You're not changing the values of the drop-downs, just having a separate drop-down2 for each possible option in drop-down1 and making 'em all invisible except for the appropriate one.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top