<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script>
function valthisform()
{
var checkboxs=document.getElementsByName("c1");
var okay=false;
for(var i=0,l=checkboxs.length;i<l;i++)
{
if(checkboxs[i].checked)
{
okay=true;
}
}
if(okay){
alert("Thank you for checking a checkbox");
}
else{
alert("Please check a checkbox");
return false;
}
}
</script>
</head>
<body>
Please select at least one Checkbox
<br>
<br>
<form name = "FC">
<input type = "checkbox" name = "c1" value = "c1"> C1 <br>
<input type = "checkbox" name = "c1" value = "c2"> C2 <br>
<input type = "checkbox" name = "c1" value = "c3"> C3 <br>
<input type = "checkbox" name = "c1" value = "c4"> C4 <br>
</form>
<br>
<br>
<input type = "submit" value = "Edit and Report" onClick = "return valthisform();">
</body>
</html>
<html>
<head>
<script>
function valthisform()
{
var checkboxs=document.getElementsByName("c1");
var okay=false;
for(var i=0,l=checkboxs.length;i<l;i++)
{
if(checkboxs[i].checked)
{
okay=true;
}
}
if(okay){
alert("Thank you for checking a checkbox");
}
else{
alert("Please check a checkbox");
return false;
}
}
</script>
</head>
<body>
Please select at least one Checkbox
<br>
<br>
<form name = "FC">
<input type = "checkbox" name = "c1" value = "c1"> C1 <br>
<input type = "checkbox" name = "c1" value = "c2"> C2 <br>
<input type = "checkbox" name = "c1" value = "c3"> C3 <br>
<input type = "checkbox" name = "c1" value = "c4"> C4 <br>
</form>
<br>
<br>
<input type = "submit" value = "Edit and Report" onClick = "return valthisform();">
</body>
</html>
No comments:
Post a Comment