frontline
03-02-2003, 09:36 AM
hello
i have this simple script i only need to unselect the selected option box
with no luck ..
what is wrong here ?
<HTML>
<HEAD>
<script>
function foo(){
var oSelect=document.oForm.blah;
for(var i=0;i<oSelect.length;i++){
oSelect.options[i].selected=false;
}
}
</script>
<TITLE> New Document </TITLE>
</HEAD>
<form name="oForm">
<SELECT NAME="blah" size="5" style="width:20px">
<option >1</option>
<option selected>2</option>
<option>3</option>
</SELECT>
</form>
<input type=button value="Unselect" onclick="foo();">
</BODY>
</HTML>
thanks!
i have this simple script i only need to unselect the selected option box
with no luck ..
what is wrong here ?
<HTML>
<HEAD>
<script>
function foo(){
var oSelect=document.oForm.blah;
for(var i=0;i<oSelect.length;i++){
oSelect.options[i].selected=false;
}
}
</script>
<TITLE> New Document </TITLE>
</HEAD>
<form name="oForm">
<SELECT NAME="blah" size="5" style="width:20px">
<option >1</option>
<option selected>2</option>
<option>3</option>
</SELECT>
</form>
<input type=button value="Unselect" onclick="foo();">
</BODY>
</HTML>
thanks!