SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    Lexington, KY
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Click here to agree...

    I'd like to create a HTML file if possible that will have two check boxes within the page and BOTH boxes must be checked before going on to the next page.

    Could anyone send me a how-to on this and how it can be done - I'd greatly appreciate it.



    -Michael

  2. #2
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should get you started...

    Code:
     <script language="Javscript">
     <!--
     
     function chkForm() {
     
      if(!document.frm.chk1.checked || !document.frm.chk2.checked) {
       alert('Please check both boxes');
       return false;
      }
      document.frm.submit();
      return true;
     }
     
     //-->
     </script>
     <form name="frm" id="frm" action="nextpage.html" method="post" onsubmit="return chkForm();">
     <input type="checkbox" name="chk1" id="chk1" value="1" /><label for="chk1">Check this box (required)</label><br />
     <input type="checkbox" name="chk2" id="chk2" value="1" /><label for="chk2">Check this box (required)</label><br />
     <input type="submit" value="Submit name="btnSubmit" />
     </form>
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •