Posted By

deftonez4me on 08/23/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


JS Check agreement checkbox on form submit


 / Published in: JavaScript
 

  1. <script type="text/javascript">
  2. function check_agreement() {
  3. //if the agreement checkbox is checked, return true, otherwise return false
  4. if(document.getElementById('LocationAgree').checked == true) {
  5. return true;
  6. } else {
  7. alert('Please agree to the terms and conditions.');
  8. return false;
  9. }
  10. }
  11. </script>

Report this snippet  

You need to login to post a comment.