0

Hi All -

Can you please look at this code for me?

I need to be able to have this script LOAD A URL when the checkbox is checked and the SUBMIT is pressed....

Thanks so much!!! :)

<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
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Please read/accept terms to submit form")
return false
}
}
}
</head>

<body>
<form name="agreeform" onSubmit="return defaultagree(this)">
Here is form or text<br>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)"><b>I agree to the above terms</b><br>
<input type="Submit" value="Submit!" disabled>
</form>

<script>
//change two names below to your form's names
document.forms.agreeform.agreecheck.checked=false
</script>
</body>
3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by amellie
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.