I don't really see the point of having two separate select lists kept in sync, but here you are:-
Code:
<form name = "myform">
<select name = "sel1" onchange = "go1()">
<option value = "1">ONE</option>
<option value = "2">TWO</option>
<option value = "3">THREE</option>
</select>
<select name = "sel2" onchange = "go2()">
<option value = "1">ONE</option>
<option value = "2">TWO</option>
<option value = "3">THREE</option>
</select>
</form>
<script type = "text/javascript">
function go1() {
var d = document.myform.sel1.selectedIndex;
document.myform.sel2.selectedIndex = d;
}
function go2() {
var d = document.myform.sel2.selectedIndex;
document.myform.sel1.selectedIndex = d;
}
</script>
Or do you mean
just/only when the third element is selected?
Code:
<form name = "myform">
<select name = "sel1" onchange = "go1()">
<option value = "1">ONE</option>
<option value = "2">TWO</option>
<option value = "3">THREE</option>
</select>
<select name = "sel2" onchange = "go2()">
<option value = "1">ONE</option>
<option value = "2">TWO</option>
<option value = "3">THREE</option>
</select>
</form>
<script type = "text/javascript">
function go1() {
var d = document.myform.sel1.selectedIndex;
if (d==2) {
document.myform.sel2.selectedIndex = d;
}
}
function go2() {
var d = document.myform.sel2.selectedIndex;
if (d==2) {
document.myform.sel1.selectedIndex = d;
}
}
</script>
Quizmaster: What M, named after the Hebrew word for "Institution", is the national intelligence agency of Isreal?
Contestant: Al-Qaeda.