/    Sign up×
Community /Pin to ProfileBookmark

go to url based on user input

Hi all,

I’m a newbie. I want a js that will have the user select from a drop down list a venue, then enter their username in one textbox, and password in another, so they’re taken to /venue/username/password.html. Eg. If the soccer player frankie has password 1111, he’ll be taken to /soccer/frankie/1111.html.

My code at the moment is this:

<!– Begin
site = “http://www.mysite.com.au/photos“; //
function combineMenus(frm, menu1, text1, text2) {
with (frm) {
str = menu1.options[menu1.selectedIndex].value;
str += text1.options[text1.selectedIndex].value;
str2 += text2.options[text2.selectedIndex].value;
url = site + “/” + str + “/” + str2 + “.html”;
window.location.href = url;
}
}
// End –>
</script>
</head>
<body
<center>
<form name=”menufrm”>
<select name=”menu1″>
<option value=””>Venue</option>
<option value=”actiondance”>Action Dance</option>
<option value=”larool”>Larool</option>
<option value=”ststephens”>St Stephens</option>
</select>
<input name=”text1″ value=”” type=”text”> <input name=”text2″
value=”” type=”text”> <input value=”Select”
onclick=”combineMenus(this.form, this.form.text1, this.form.text2)”
type=”button”></form>
</center>
<p><br>
</p>
</body>
</html>

Any ideas? Thanks in advance, really appreciate any help for a poor boy down under

Doric

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KorMay 28.2010 — <i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;meta http-equiv="Content-Style-Type" content="text/css"&gt;
&lt;meta http-equiv="Content-Script-Type" content="text/javascript"&gt;
&lt;script type="text/javascript"&gt;
function combineMenus(m1,t1,t2){
location.href='http://www.mysite.com.au/photos/'+m1.value+'/'+t1.value+'/'+t2.value+'.html';
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form name="menufrm"&gt;
&lt;select name="menu1"&gt;
&lt;option value=""&gt;Venue&lt;/option&gt;
&lt;option value="actiondance"&gt;Action Dance&lt;/option&gt;
&lt;option value="larool"&gt;Larool&lt;/option&gt;
&lt;option value="ststephens"&gt;St Stephens&lt;/option&gt;
&lt;/select&gt;
&lt;input name="text1" value="" type="text"&gt;
&lt;input name="text2" value="" type="text"&gt;
&lt;input value="Select" onclick="combineMenus(menu1,text1,text2)"
type="button"&gt;&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@skibugauthorMay 28.2010 — Dear Kor,

I hope you did not spend as much time on this as I did ;>) - thank you so much for your help - whenever I use a world globe I will look at Bucharest with added warmth.

Thank you again,

Doric
Copy linkTweet thisAlerts:
@KorMay 31.2010 — Dear Kor,

I hope you did not spend as much time on this as I did ;>) - thank you so much for your help - whenever I use a world globe I will look at Bucharest with added warmth.

Thank you again,

Doric[/QUOTE]

You are welcome in Bucharest as well, if the hazard will bring you here ?
Copy linkTweet thisAlerts:
@sohguanhMay 31.2010 — You are welcome in Bucharest as well, if the hazard will bring you here ?[/QUOTE]

I get to know of Romania this country from their legendary soccer player Gheorghe Hagi and then later on the lesser Adrian Mutu. To me Hagi and Hristo Stoikov from Bulgaria rank among the best East European soccer players to make their mark in the international soccer scene.

Sad to say, nowadays Romania and Bulgaria soccer teams are shades lesser compared to their earlier players. Even the Czech and Yugoslav soccer players have lost their shine.
×

Success!

Help @skibug 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 6.18,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...