Arsenal Posted April 19, 2007 Share Posted April 19, 2007 My goal is to make it so if the check box is checked, the page continues as normal. If the checkbox is not checked, then the page is redirected. I don't get any syntax errors but the code does not do what it is intended. What am I missing? <script language="JavaScript"> function check_agreement(){ if(document.getElementById('term_agreement') == false){ window.location = 'index.php'; } } </script> <form name="registration" enctype="application/x-www-form-urlencoded" method="post" action="index.php?PHPKatalyst=register&step=user_info" onSubmit="check_agreement();"> In order to proceed, you must agree to the following <strong>Terms & Conditions</strong>:<br /><br /> <fieldset stlye="font-style: italic;"> </fieldset> <label for="term_agreement"><input type="checkbox" name="term_agreement" id="term_agreement" />If you agree to these <strong>Terms & Conditions</strong>, then check this box.</label> <div style="text-align: center;"><input type="submit" value="Continue" /></div> </form> Quote Link to comment Share on other sites More sharing options...
fenway Posted April 20, 2007 Share Posted April 20, 2007 if(document.getElementById('term_agreement') == false){ You mean to check the .value.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.