Results 1 to 3 of 3

Thread: goto page textbox form

  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default goto page textbox form

    Hi All!!

    A bit of a noob here but I was wondering if the following was possible.

    I have a simple webpage that is going to say
    "to find your page enter your ref no below"

    Then I was hoping for a textbox and a go button........and when they click on the button it takes them to a matching page.

    Eg, James has the reference AF54 so when he types it in, clicks go he will be redirected to

    http://www.mysite.com/AF54.htm

    Nothing personal or security required just a wee info page for them.

    I hope someone can help

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That idea has at least one major flaw. The user may input anything, and there is no guarantee that the page it represents exists. That said:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    </head>
    <body>
    <form action="#" onsubmit="location = this.elements.choice.value + '.htm'; return false;">
    <input type="text" name="choice"> <input type="submit" value="Go">
    </form>
    </body>
    </html>
    That'll do it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much!!!

    That did the trick

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
  •