Forum Moderators: open

Message Too Old, No Replies

Force user to check box before continuing

purchasing agreement

         

conroy

5:27 pm on Feb 22, 2005 (gmt 0)

10+ Year Member



On my checkout page I've got a link to the final order page. I also have a link to the purchase agreement. However, I want the user to be forced to check a box next to the purchase agreement saying they have read it before they are allowed to continue to make a purchase. If they click on the link to the final order page without checking the box, I want a message to popup and inform them that they must agree with the terms first.

I tried to do a search but couldn't think of a way to describe this. Any ideas?

orion_rus

6:03 pm on Feb 22, 2005 (gmt 0)

10+ Year Member



You can make submit buttons in a form.
and your checkbox can seems like so:
<form action='needed location' method='post' >
<input type='ckeckbox' onclick='submit.disabled=(submit.disabled=="true")?false:true' />
<input type='submit' disabled (or disabled=true) name='submit' value='Load page' />
</form>

if u still want to do it with href's
u can make so
var click='true';
function stopclick()
{ahref=document.getElementById('neededhref');
if (click) {newvar=function() {return true;};click=false;} else {
newvar=function () {return false;};click=true;}
ahref.onclick=newvar;
}
<input type='ckeckbox' onclick='stopclick()' />
<a id='neededhref' href='somesource' onclick="return false"/>
I hope it helps
good luck to you

Bernard Marx

6:34 pm on Feb 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't name submit a button, 'submit'. The form already has a member by that name.
It's submit method. Choose something else.

qazwer

11:06 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



<form action='some location' method='post' >
<input type='checkbox' onclick='submitIt.disabled=(submitIt.disabled=="true")?false:true' />
<input type='submit' disabled (or disabled=true) name='submitIt' value='Load page' />
</form>

Hmmm.. how would you make this work because: <input type='checkbox' onclick='submitIt.disabled=(submitIt.disabled=="true")?false:true' /> doesn't work. If you check the box the button still remains disabled and I suppose you need this button to go to 'some location'

rocknbil

2:04 am on Feb 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<form action="post" action="your_processor" onSubmit="return false;">
<input type ="checkbox" name="agree" value="anything">
<b>Click me or the buck stops here.</b>
<input type="submit" name="submitButton" onClick="check_agree(this.form);" value="Go">
</form>

<script language="Javascript">
function check_agree (form) {
if (form.agree.checked) {
form.submitButton.disabled = true;
form.submit();
}
else { alert('If you don\'t agree, we set you free.'); }
}

</script>

qazwer

2:33 am on Feb 25, 2005 (gmt 0)

10+ Year Member



Super, thanks rocknbil!

conroy

1:44 am on Feb 28, 2005 (gmt 0)

10+ Year Member



Thanks for all the responses. I'm still not getting it.

Where do I input the URL that I want the visitor to go once they have checked the box?

qazwer

2:34 am on Feb 28, 2005 (gmt 0)

10+ Year Member



Change the following line in the script rocknbil supplied:

<form action="post" action="put_the_URL_that_you_want_the_visitor_to_go_here.extension" onSubmit="return false;">