/    Sign up×
Community /Pin to ProfileBookmark

JS Help – URL w/ Variable from a form.

What I want the user to be able to do is type in a variable, and then click “GO”. Let’s say the variable they type is “12345678”. The website they go when they click “GO” is “http://www.website.com/page.asp?something=12345678

All I want this to be is a form with a form field and a button. I used to have the script years ago, but lost it. Now, I can’t for the life of me find it. Very annoying.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@clairec666Feb 27.2004 — <form action = 'http://www.website.com/page.asp' method = 'get'>

<input type='text' name='something' />

<input type='submit' value='Go'/>

</form>
Copy linkTweet thisAlerts:
@jasonbowerauthorFeb 27.2004 — GREAT. works like a dream. The one I had was a bit more difficult and more difficult to implement, but this one works great.
Copy linkTweet thisAlerts:
@jasonbowerauthorMar 04.2004 — Just got a new requirement. I now need to pass a new variable into the mix.

The problem is that the variable is the URL. We have a server farm and I need to be able to pick from http://server1.domain.com/?var1=123&var2=456 and http://server2.domain.com/?var1=123&var2=456

Basically, I need to combine 3 user-defined fields into the above format and make it go to the URL that the 3 fields combined make up.

I found a way to type a URL into a field then hit go (http://www.javascriptkit.com/script/script2/urljump.shtml)

I need to add 2 more fields to it and have the 2 fields go on the end of what is in the first field.
×

Success!

Help @jasonbower spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...