Jump to content

Checkbox Validation


sseeley

Recommended Posts

I am trying to validate a check box, but my return always just come back with 'on'.  Can anyone help me?

 

<head>
<script>
<!--	
	function validate()
	{
			var deleted=document.getElementById("del").value
			alert(deleted);
	}
-->
</script>
</head>
<?php
echo "<form action=\"test1.php\" method=\"POST\" name=\"paymentsForm\" onsubmit=\"return validate()\">";
echo "<input type=\"checkbox\" name=\"deleted\" id=\"del\"></td>";
echo "<input type = \"submit\">";
echo "</form>";
?>

 

Many thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/161097-checkbox-validation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.