bsxiong
06-04-2008, 11:19 AM
I just want an alert saying that they will need to select at least one of the box to continue.
anyhelp? I just can't get it to work.
<title>MANY VALIDATIONS</title>
<style type="text/css">
body {width:600px; padding:10px; font-family: verdana; font-size: 12px;}
</style>
<noscript>Javascript is currently turned off, Please turn it back on for this page to work.</noscript>
<script type="text/javascript">
function validate()
{
var computer2 = document.classroom.computer;
for($i = 0; $i < computer2.length; $i++){
alert(computer2[$i])
}
}
</script><form name=classroom method=post onSubmit="return validate()">
<p>
<input name="computer[]" type="checkbox" value="1">1
<input name="computer[]" type="checkbox" value="2">2
<input name="computer[]" type="checkbox" value="3">3
<input name="computer[]" type="checkbox" value="4">4<br>
<input type="submit" name="submit">
</form>
anyhelp? I just can't get it to work.
<title>MANY VALIDATIONS</title>
<style type="text/css">
body {width:600px; padding:10px; font-family: verdana; font-size: 12px;}
</style>
<noscript>Javascript is currently turned off, Please turn it back on for this page to work.</noscript>
<script type="text/javascript">
function validate()
{
var computer2 = document.classroom.computer;
for($i = 0; $i < computer2.length; $i++){
alert(computer2[$i])
}
}
</script><form name=classroom method=post onSubmit="return validate()">
<p>
<input name="computer[]" type="checkbox" value="1">1
<input name="computer[]" type="checkbox" value="2">2
<input name="computer[]" type="checkbox" value="3">3
<input name="computer[]" type="checkbox" value="4">4<br>
<input type="submit" name="submit">
</form>