#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Location
    Hollywood, CA
    Posts
    2
    Rep Power
    0

    Can I make FORM input generate URL without "name="?


    Can I make FORM input generate URL without "name="?

    (I've used the forum SEARCH, but couldn't find the answer -- although I'm not ruling out that my query was poorly written and didn't turn up an answer which has been previously posted.)

    I have a hand-written HTML "Start Page" for my browser which has all my favorite links, and a Google Search box. I used this code for my Google Search:

    Code:
    <form method="get" action="http://www.google.com/search">
      <input type="text" name="q" size="20" maxlength="255" value="">
    </form>
    I would like to make another search box for a different site. The resultant URL should look like this:

    Code:
    http://example.com/inputtext
    I have tried tweaking my Google code, but I can't get the resultant URL not to include "?q="

    Can it be done?

    Thanks.

    Jerry
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    50
    If you use a form with the GET method, you'll get the ?parameters in the URL.

    To open a new page with the URL the way you want, a fairly simple javascript will do it. You'll probably want to use an onclick event and probably something like window.location.replace(url).
  4. #3
  5. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Location
    Ludhiana
    Posts
    33
    Rep Power
    0
    no you cant. In order to GET or POST data, the name is necessary. It is needed by a programmer.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Location
    Hollywood, CA
    Posts
    2
    Rep Power
    0
    Thanks Shelly. At least I can stop looking for the needle in the haystack now that I know there's no needle there!

IMN logo majestic logo threadwatch logo seochat tools logo