L
Lorenzo Thurman
When using this code, I can get the value of the select. But this only
works if the select is within a form. The commented code, which I think
_should_ work, does not work whether it's in a form or not. This happens
in both IE6 and Firefox 1.506 and also Flock 0.7.3.2.My javascript
skills are not all that great, but am I missing something?
Thanks
function setStatusText(){
//var index = document.getElementById('bridgeSelect').value;
var str= document.forms['test'].options.value;
document.getElementById('bridgeStatus').innerHTML = str;
}
####################
<body>
<form name='test'>
<div id="bridgeSelect"
onchange="toggleBridgeStatus(false);setStatusText()"><select name="options">
<option value="status" selected="yes">Status
<option value="option1">Option1
<option value="option2">Option2
</select>
</div>
</form>
</body>
works if the select is within a form. The commented code, which I think
_should_ work, does not work whether it's in a form or not. This happens
in both IE6 and Firefox 1.506 and also Flock 0.7.3.2.My javascript
skills are not all that great, but am I missing something?
Thanks
function setStatusText(){
//var index = document.getElementById('bridgeSelect').value;
var str= document.forms['test'].options.value;
document.getElementById('bridgeStatus').innerHTML = str;
}
####################
<body>
<form name='test'>
<div id="bridgeSelect"
onchange="toggleBridgeStatus(false);setStatusText()"><select name="options">
<option value="status" selected="yes">Status
<option value="option1">Option1
<option value="option2">Option2
</select>
</div>
</form>
</body>