S
steve cole
Hi All
No doubt I am doing something stupid since i am new to javascript
I have a problem with the following code, when run on IE6 the value for
opt_sel is null but on Mozilla or konqueror the value is the option
selected (as expected). I have tried several books on the matter(and
google), but they seem to indicate that what i am trying to do should
work... Very annoying!
I have made the script as simple as possible to illustrate my problem.
please help, this is driving me crazy!!!!
<html>
<head>
<script language=JavaScript type=text/javascript>
function check_form(){
alert (document.form1.opt_sel.value)
}
</script>
</head>
<body>
<form name=form1 id=form1>
<select name="opt_sel" id="opt_sel">
<option selected>opt1</option>
<option>opt 2</option>
<option>opt 3</option>
</select>
<input name="submit" value="submit" type="submit" onclick=check_form()>
</form>
</body>
</html>
Thanks
Steve
No doubt I am doing something stupid since i am new to javascript
I have a problem with the following code, when run on IE6 the value for
opt_sel is null but on Mozilla or konqueror the value is the option
selected (as expected). I have tried several books on the matter(and
google), but they seem to indicate that what i am trying to do should
work... Very annoying!
I have made the script as simple as possible to illustrate my problem.
please help, this is driving me crazy!!!!
<html>
<head>
<script language=JavaScript type=text/javascript>
function check_form(){
alert (document.form1.opt_sel.value)
}
</script>
</head>
<body>
<form name=form1 id=form1>
<select name="opt_sel" id="opt_sel">
<option selected>opt1</option>
<option>opt 2</option>
<option>opt 3</option>
</select>
<input name="submit" value="submit" type="submit" onclick=check_form()>
</form>
</body>
</html>
Thanks
Steve