There are at least 6 or 7 checkboxes on a page. And someone can ONLY check ONE checkbox. If they check more then one they get an al3rt message.
I can only do it if they DON'T check the checkbox.
This is what I have so far:
<script language="javascript">
function validate() {
var check = false
for (i=0; i<=6; i++) {
if (document.formsreq.APPLICATIONS(i).checked) {
check = true
}
}
if (check == true) {
return true;
}
else {
alert("You must select a form!"
;
return false;
}
}
</script>
Anyone see what I'm doing wrong? I have not failed; I merely found 100,000 different ways of not succeding...
I can only do it if they DON'T check the checkbox.
This is what I have so far:
<script language="javascript">
function validate() {
var check = false
for (i=0; i<=6; i++) {
if (document.formsreq.APPLICATIONS(i).checked) {
check = true
}
}
if (check == true) {
return true;
}
else {
alert("You must select a form!"
return false;
}
}
</script>
Anyone see what I'm doing wrong? I have not failed; I merely found 100,000 different ways of not succeding...