Here's a script that disables the submit button unless the checkbox is checked. You can probably adapt it to your needs. Can't remember were I found it...
NOTE: This is not secure. Someone with knowledge of javascript could easily undisable the submit button. If you want it to be secure, you will have to use a server side language.
HTML Code:
<html>
<head>
<script>
var checkobj
function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){ //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}
</script>
</head>
<body>
<form>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)">I agree to the terms and conditions</a><br>
<input type="submit" name="submit" value="Register" disabled="true">
</form>
</body>
</html>
Bookmarks