Hi,
can anyone tell me if netscape 4.x knows about the options.value property? Basically I have a dropdown box populated from the database, with the value set to an ID and another field displayed to the user.
Based on as selection I want to grab the ID which is set as each option value attribute and pass it to a function which will select the same Id in another drop down with the same ID.
This work in IE5.x, Netscape 6.x, but not Netscape 4.7. Does anyone know a workaround?
Code to highlight below
<html>
<SCRIPT LANGUAGE = "JavaScript">
<!--
function XXX() {
alert(document.form1.cars.options[document.form1.cars.selectedIndex].value);
document.form1.cars.options.value = 2;
}
// -->
</SCRIPT>
<form name="form1">
<body>
<select name="cars">
<option value="1">Volvo</option>
<option value="2">Saab</option>
<option value="3">Fiat</option>
<option value="4">Audi</option>
</select>
<input type='button' value='Run' onClick='XXX();'>
</body>
</form>
</html>
can anyone tell me if netscape 4.x knows about the options.value property? Basically I have a dropdown box populated from the database, with the value set to an ID and another field displayed to the user.
Based on as selection I want to grab the ID which is set as each option value attribute and pass it to a function which will select the same Id in another drop down with the same ID.
This work in IE5.x, Netscape 6.x, but not Netscape 4.7. Does anyone know a workaround?
Code to highlight below
<html>
<SCRIPT LANGUAGE = "JavaScript">
<!--
function XXX() {
alert(document.form1.cars.options[document.form1.cars.selectedIndex].value);
document.form1.cars.options.value = 2;
}
// -->
</SCRIPT>
<form name="form1">
<body>
<select name="cars">
<option value="1">Volvo</option>
<option value="2">Saab</option>
<option value="3">Fiat</option>
<option value="4">Audi</option>
</select>
<input type='button' value='Run' onClick='XXX();'>
</body>
</form>
</html>