kj2w
09-16-2003, 02:44 PM
I have a multiple select box. Before I submit my form, I'd like to make sure that something is selected otherwise throw an alert box.
Example:
<form name="myForm" action="test.html" method="post">
<select name="sB" multiple>
<option name="test">Test</option>
<option name="test2">Test2</option>
<option name="test3">Test3</option>
</select>
</form>
<script laguage="JavaScript">
if(?document.myForm.sb.checked?){
document.myForm.submit();
}
</script>
Any Ideas,
Jason
Example:
<form name="myForm" action="test.html" method="post">
<select name="sB" multiple>
<option name="test">Test</option>
<option name="test2">Test2</option>
<option name="test3">Test3</option>
</select>
</form>
<script laguage="JavaScript">
if(?document.myForm.sb.checked?){
document.myForm.submit();
}
</script>
Any Ideas,
Jason