jonnyhay
03-11-2009, 05:45 AM
"Accept terms" form submission
http://dynamicdrive.com/dynamicindex16/acceptterm.htm
I have researched the "accept terms" script, but I have not found a way so when you click on the submit button, it can link to a new page or URL. I ultimately want so the client can click I agree and then sign up via paypal for a monthly subscription. Not sure if that is possible.
I will be satisfied if I can just take them to a page where I have the paypal "buy now" button.
The user clicks submit, and it simply goes to a URL of another page on your site, "enroll.html" for example.
Any help would be greatly apprectiated!
Here the code for the <HEAD>:
<script>
//"Accept terms" form submission- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use
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
}
}
and for the Form:
<form name="agreeform" onSubmit="return defaultagree(this)">
Rest of your form here<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>
<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
}
</script>
http://dynamicdrive.com/dynamicindex16/acceptterm.htm
I have researched the "accept terms" script, but I have not found a way so when you click on the submit button, it can link to a new page or URL. I ultimately want so the client can click I agree and then sign up via paypal for a monthly subscription. Not sure if that is possible.
I will be satisfied if I can just take them to a page where I have the paypal "buy now" button.
The user clicks submit, and it simply goes to a URL of another page on your site, "enroll.html" for example.
Any help would be greatly apprectiated!
Here the code for the <HEAD>:
<script>
//"Accept terms" form submission- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use
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
}
}
and for the Form:
<form name="agreeform" onSubmit="return defaultagree(this)">
Rest of your form here<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>
<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
}
</script>