Jump to content

So.... A simple check box


Recommended Posts

I am needing to include a check box at the bottom of my payment form to be sure that users have read my terms and conditions. I have seen it hundreds of times on various websites. The user cannot complete sale unless they check the box. Is this an easy thing to code? Thanks in advance guys Cammie

Link to post
Share on other sites

Ok, I am kinda new to DW and HTML so please bear with me here... I get the whole code part for checking the box but how do I prevent the user from proceeding from page without checking it. I want them to click box to accept terms before they can proceed and click 'purchase'...

Link to post
Share on other sites

<form onsubmit="return check();"> rest of inputs..<input type="checkbox" id="check1" name="check1" /><input type="submit" value="submit"></form>

function check() {var valid = true;tc_check = document.getElementById("check1"); if(tc_check.checked!=true){alert("Oops you forgot the T and C")valid = false}return valid;}

the onsubmit="return check();" in the form element calls the check function and waits for returned true or false response, if true submit the form, else do not.

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...