blitz104
05-26-2009, 03:13 AM
<html>
<script type="text/javascript">
function test(){
if(document.strp.spear.checked == false){
alert(yes)
}
}
</script>
<form name="strp">
<input type="checkbox" name="spear">
<input type="button" value="Test" onclick="test()">
</form>
</html>
I'm trying to learn to validate checkboxes, but it isn't working. When I run the above code, clicking the button does nothing. Any ideas?
<script type="text/javascript">
function test(){
if(document.strp.spear.checked == false){
alert(yes)
}
}
</script>
<form name="strp">
<input type="checkbox" name="spear">
<input type="button" value="Test" onclick="test()">
</form>
</html>
I'm trying to learn to validate checkboxes, but it isn't working. When I run the above code, clicking the button does nothing. Any ideas?