is there script validation for check box
Posted: Fri Aug 11, 2006 8:18 am
hi
is there script validation for check box
is there script validation for check box
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<script type="text/javascript">
function validate()
{
x = document.formname.getelementbyid(my_box).value;
if (x == 1)
{
document.formname.submit();
}
else
{
alert('Check the box!');
}
}
</script>
<form name="formname" action="submit.htm">
<input type="checkbox" id="my_box" name="box" value=1 />
<input type="button" value="submit" onclick="validate()" />
</form>