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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sincronized drop-down lists

Status
Not open for further replies.

Mandrutza

Programmer
Feb 12, 2002
34
RO
So I have 3 drop-down lists.When an user selects an option from one drop-down list I want that the other two list to display the option with the same index.Must work with all three drop-down lists.
I hope you understood my problem.
Thanks.
 
if you dont want the page to refresh just place all the values for each dd into javascript arrays and then recreate the drop down lists from the arrays as they are needed
 
:->
Thank you all for help, but I solved my problem with JS (shame on me that I know so less about it).I only had to write down some lines:
(Thanks and courtesy of STARWAY)

function change(item){
document.f1.select1.selectedIndex=item.selectedIndex
document.f1.select2.selectedIndex=item.selectedIndex
document.f1.select3.selectedIndex=item.selectedIndex
}
.
.
<form name=f1>
<select name=select1 onchange=&quot;change(this);&quot;>
<option selected>klm
<option>hju
...
</select>

<select name=select2 onchange=&quot;change(this);&quot;>
<option selected>jiu
<option>mnu
...
</select>

<select name=select3 onchange=&quot;change(this);&quot;>
<option selected>hdy
<option>yet
...
</select>

That's all folks.
Again, thans to STARWAY.:-V
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top