ImperialSpider
01-28-2005, 04:38 AM
What I am wanting is this...once the user checks the box, and clicks submit...the prompt comes up with an 'OK' button. I want the user to be redirected to "\page1.html" when they click that 'OK' button. What do I need to do, or what do I need to change in my code???
Below is the code I am using:
<html><title>agreement form</title>
<P>
<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 (window.checkobj&&checkobj.checked)
alert("Great, Lets get started.")
else
alert("Please check the box if your agree to the conditions")
return false
}
</script>
<BODY BGCOLOR="#00FFFF">
<form name="agreeform" onSubmit="return defaultagree(this)">
YOU MUST MEET MY CONDITIONS, WHICH ARE...<br><br>
<textarea rows="5" name="S1" cols="30" style="width:60%" wrap=virtual>
1. FIRST CONDITION.
2. SECOND CONDITION.
3. THIRD CONDITION.
4. FOURTH CONDITION.
5. FIFTH CONDITION.
6. SIXTH CONDITION.
7. SEVENTH CONDITION.
</textarea><p>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)">
<b>Check box if you agree to the above conditions</b><p>
<input type="Submit" value="Submit!">
</form>
<script>
document.forms.agreeform.agreecheck.checked=false
</script>
<p><p>
</body></head></html>
Thanks in advance for your help.
Below is the code I am using:
<html><title>agreement form</title>
<P>
<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 (window.checkobj&&checkobj.checked)
alert("Great, Lets get started.")
else
alert("Please check the box if your agree to the conditions")
return false
}
</script>
<BODY BGCOLOR="#00FFFF">
<form name="agreeform" onSubmit="return defaultagree(this)">
YOU MUST MEET MY CONDITIONS, WHICH ARE...<br><br>
<textarea rows="5" name="S1" cols="30" style="width:60%" wrap=virtual>
1. FIRST CONDITION.
2. SECOND CONDITION.
3. THIRD CONDITION.
4. FOURTH CONDITION.
5. FIFTH CONDITION.
6. SIXTH CONDITION.
7. SEVENTH CONDITION.
</textarea><p>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)">
<b>Check box if you agree to the above conditions</b><p>
<input type="Submit" value="Submit!">
</form>
<script>
document.forms.agreeform.agreecheck.checked=false
</script>
<p><p>
</body></head></html>
Thanks in advance for your help.