rendered paste body <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>html</title>
<?
<script>
// Function to check that one or more radio buttons are selected
function is_multiple_checked() {
var formObj = document['payment.php']['q[]'];
var count = 1;
for (i=0;i<formObj.length; i++)
{
if(formObj.type == 'checkbox')
if(formObj[i].checked)
count++;
}
if (count < 1)
{
return false;
}
if (count > 1)
{
return true;
}
else {
return false;
}
}
// Function to call checkbox function (?)
function val(){
if (!is_multiple_checked()){
alert ('sel one of them');
return false;
}
else {
alert ('selected one or more and submitting');
return false;
}
}
</script>
?>
</head>
<body>
<form name="payment.php" action="/" method="post" onsubmit="is_multiple_checked()">
<input type="checkbox" name="Lake" value="1" />Rice Lake 2007<br />
<input type="checkbox" name="Scugog" value="2" />Lake Scugog 2007<br />
<input type="checkbox" name="Simcoe" value="3" />Lake Simcoe 2007<br />
<input type="checkbox" name="Nipissing" value="4" />Lake Nipissing 2007 <br />
<input type="submit" value="send" />
</form>
</body>
</html>