Checkbox redirection using JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neogazz
    New Member
    • Apr 2010
    • 55

    Checkbox redirection using JavaScript

    How would you design a webpage <form> which contains a "checkbox" that when checked and the 'submit' button is pressed will automatically redirect the user to another webpage??

    If the "checkbox" is not checked and the 'submit' button is pressed, then it will not direct user to another webpage.

    I want to use JavaScript for this.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you are aware that this won’t work with JavaScript disabled?

    basically, you just need to return the .checked property of that checkbox onsubmit (if checked, submit is executed, otherwise not).

    Comment

    • neogazz
      New Member
      • Apr 2010
      • 55

      #3
      By default is 'JavaScript' turned off on all IE and FireFox webpages?

      Thanks for the reply.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        that depends on the User. if (s)he uses the NoScript Add-on, (one of the most downloaded Add-ons!), that’s the default action (turning JS off).

        Comment

        • neogazz
          New Member
          • Apr 2010
          • 55

          #5
          Many thanks, excellent advice!

          Comment

          Working...