dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Detect value of form and return to page?

  1. #1
    Join Date
    Jun 2011
    Posts
    4

    Detect value of form and return to page?

    Hi, What i'm trying to do is pretty simple. I want to detect if the value of a field in a form called "check" and if the value is "1" return the user to a different page. i also want it so if the value is anything else the user is returned to the homepage. Here's what i have so far:

    HTML Code:
    <html>
    <body>
    
    <form name="check" >
    <input type="hidden" name="check" id="check" value="0" />
    </form>
    
    <script type="text/javascript">
    
    document.getElementsByTagName("check")
    
    if (document.getElementById("check").value = "1")
      {
      document.write("Good!");
      }
    else
      {
      document.write("bad");
      }
    </script>
    </body>
    </html>
    Thanks!

  2. #2
    Join Date
    Jun 2011
    Posts
    4
    I'd like to actually do nothing if the value is set to "1"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles