maggiemay654
05-01-2003, 04:59 PM
Hello!
I have this script that should verify that ALL boxes in the form are checked. It works for all but the last box, you can click the last box only & it will perform the action. Can you tell me how to make it verify the last box as well? Thank you so much!!
Here's the script:
<HTML><HEAD><TITLE> None</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkCheckBox(f){
if (f.charge1.checked == false )
{
alert('Please check all boxes to continue.');
return false;
}else
return true;
}function checkCheckBox(f){
if (f.charge2.checked == false )
{
alert('Please check all boxes to continue.');
return false;
}else
return true;
}
function checkCheckBox(f){
if (f.charge3.checked == false )
{
alert('Please check all boxes to continue.');
return false;
}else
return true;
}
// End -->
</script></HEAD><BODY>
<form name="shipping" ACTION="orderform.htm" METHOD="POST" onsubmit="return checkCheckBox(this)">
<input type="checkbox" name="charge1" value="0"> Description 1 <p>
<input type="checkbox" name="charge2" value="0"> Description 2 <p>
<input type="checkbox" name="charge3" value="0"> Description 3 <p>
<input type=submit value="submit">
</form>
</BODY>
</html>
I have this script that should verify that ALL boxes in the form are checked. It works for all but the last box, you can click the last box only & it will perform the action. Can you tell me how to make it verify the last box as well? Thank you so much!!
Here's the script:
<HTML><HEAD><TITLE> None</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkCheckBox(f){
if (f.charge1.checked == false )
{
alert('Please check all boxes to continue.');
return false;
}else
return true;
}function checkCheckBox(f){
if (f.charge2.checked == false )
{
alert('Please check all boxes to continue.');
return false;
}else
return true;
}
function checkCheckBox(f){
if (f.charge3.checked == false )
{
alert('Please check all boxes to continue.');
return false;
}else
return true;
}
// End -->
</script></HEAD><BODY>
<form name="shipping" ACTION="orderform.htm" METHOD="POST" onsubmit="return checkCheckBox(this)">
<input type="checkbox" name="charge1" value="0"> Description 1 <p>
<input type="checkbox" name="charge2" value="0"> Description 2 <p>
<input type="checkbox" name="charge3" value="0"> Description 3 <p>
<input type=submit value="submit">
</form>
</BODY>
</html>