Hello, I found this free script that I want to use on my order form (disables order button until agreed to terms by clicking checkbox). It is working, but I would like to use an image.gif-button instead of a Submit-button.
Would be grateful if someone could explain how to change in the script from “disable Submit-button”-action to “disable image.gif-button”-action. I’ve tried to do it myself, but I don’t know much about Javascript, and couldn’t get it to work.
My 2nd question: Can this type of action only be done in Javascript, or could there be a solution whereby the checkbox on the html-page calls a php-page to get the same type of validation?
Thank you
The script:
[COLOR=“Blue”]<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” />
<title>Checkbox Form Validation</title>
<script type=“text/javascript”>
function AuthorizeValidation(myform) {
if(myform.iagree.checked == true) {myform.validation.disabled = false }
if(myform.iagree.checked == false) {myform.validation.disabled = true }
}
</script>
</head>
<body>
<form action=“” method=“post” name=“myform”>
<p><input type=“checkbox” name=“iagree” value=“valeur” onClick=“AuthorizeValidation(this.form)” /> I agree with general terms and conditions</p>
<p><input type=“submit” name=“validation” value=“Order” disabled /></p>
</form>
</body>
</html>[/COLOR]