Please clean js. There are 2 selekta, how to make it so that when choosing one selector in the 2nd, the value of the same index is automatically substituted, see
<form name="myform"> <select name="mysel1" style="width: 135px; onchange="onSel(this.form.mysel1)""> <option value="uno">uno</option> <option value="duo">duo</option> <option value="tre">tre</option> </select><br /> <select name="mysel2" style="width: 135px; onchange="onSel(this.form.mysel2)""> <option value="unos">unos</option> <option value="dos">dos</option> <option value="tres">tres</option> </select> </form>
I explain: I chose duo (1st select), in the 2nd select the dos was substituted, if we chose a valid tres (2nd select), then in the 1st select the tre was selected. Navigate by index!
half turned out:
function onSel(dropdown){ selIndx = dropdown.selectedIndex; switch(dropdown.name) { case 'mysel1': document.form.mysel2.options[selIndx].selected == true; break; case 'mysel2': document.form.mysel1.options[selIndx].selected == true; break; } }
Alas, the error hangs, can not find such a select.