Results 1 to 2 of 2

Thread: Build new URL on form input

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

    Default Build new URL on form input

    Hi All,

    I'm searching for a while now how to generate a new url based on a form input. Here is the thing I'd like to do:

    form-date: input mmdd [2208] for 22th of august.
    submit: go to [http://start of the url][2208 - as in input][rest of the url].pdf

    is this possible in Javascript, or can someone help me to search a better way to do?

    ps. I don't have possibilities in PHP

    thanks in advance!
    Peter

  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

    Code:
    <form action="#" onsubmit="location.href = 'http://whatever.com/whatever' + this.elements.date.value + 'whatever.pdf'; return false;">
    <input type="text" name="date"> <input type="submit" value="Go">
    </form>
    - John
    ________________________

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

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
  •