Results 1 to 3 of 3

Thread: Text form field leads to URL?

  1. #1
    Join Date
    Sep 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Text form field leads to URL?

    Hi all

    I have 26 folders inside a website, labelled 'a' to 'z'.

    On the home page of the site I want a text form field, with a submit button.

    If someone lands on the site's home page and types in eg j in the text form field, I want them to land on the 'j' folder home page

    Does anyone know if a script like that is out there somewhere?

    I can't google it because I can't figure out what search term to use

    I hope someone can help

    Cheers

    Old John

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Code:
    <form>
    <p>Enter any single letter and click submit.</p>
    <input type="text" name="letter" size="1">
    <input type="button" value="Submit" name="B1"
    onclick="document.location.href = letter.value + '/index.html'">
    </form>
    make sure each folder has a page called "index.html" (or whatever you want to name each folder's home page).
    this also supposes that the a-z folders are all in the same folder as this form.
    also, make sure the text input name (here, "letter") is the same in both spots.
    Last edited by traq; 02-23-2009 at 05:00 AM.

  3. #3
    Join Date
    Sep 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Worked like a dream, Traq!

    Thank you very much mate!

    Cheers

    John

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
  •