www.webdeveloper.com
Results 1 to 4 of 4

Thread: <input> issue

  1. #1
    Join Date
    Oct 2012
    Posts
    2

    <input> issue

    Hi all, I know that there was a post about this already, but it was back in 2005. Just wondering you could you help me out.

    I've a simple piece of code that users will enter a promotional code and they then will be brought to a registration page once they've submitted the code.
    However the issue that I'm find is that when I click submit it goes straight to the page even though there is a restriction applied to the input text.

    the code:

    <form action="demo_form.asp">
    Code: <input type="text" name="code" required="required" />
    <input type="submit" value="submit" onclick="window.location='http://www.#.com'">
    </form>

    How can I set it that the onclick will look to see if the promotional code has been entered?

    Thanks in advance.
    C

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,105
    Why are you using an onclick on your submit button? You're taking them away before the form is submitted.

    Here's an example of what I'm thinking you're trying to do:
    http://jsfiddle.net/FPdFQ/
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Oct 2012
    Posts
    2
    Hi cbVision,

    Thanks for getting back to me. I am bringing them away as I want to lead them from a callout page to a registration page, so they sign up, and on from there.
    Can I then set where the sample you gave there, to open the registration page that I want it to be brought to?

  4. #4
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,105
    Why don't you modify the demo_form.asp to direct them to the appropriate page after the form submits?
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

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