By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,985 Members | 2,907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,985 IT Pros & Developers. It's quick & easy.

write link from selection

P: n/a
Hi, I have a page with the following code.

<input type=button value="Show"
onclick="location.href='my.do?para=XXXX">
....
<form>
....
</form>

<select name="myselect">
<option value=1>1
<option vlaue=2>2
<option value=3>3
....
</select>

When use click the Show button, I would like to replace the XXX by the
selected number from the selection "myselect". Since there is a form
between <intput button> and the selection, I can not use form for the
Show button.

How can I write the onclick="location.href='my.do?para=XXXX?

Thanks,

qq

Jan 9 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
qu******@yahoo.com said the following on 1/8/2006 12:58 PM:
Hi, I have a page with the following code.

<input type=button value="Show"
onclick="location.href='my.do?para=XXXX">
....
<form>
....
</form>

<select name="myselect">
<option value=1>1
<option vlaue=2>2
<option value=3>3
....
</select>

When use click the Show button, I would like to replace the XXX by the
selected number from the selection "myselect". Since there is a form
between <intput button> and the selection, I can not use form for the
Show button.

How can I write the onclick="location.href='my.do?para=XXXX?

<input type="button" value="Show"
onclick="if (parameter){location.href='my.do?para='+parameter}
else {alert('Please choose a Select Item')}">

<select name="selectList"
onchange="var parameter = this.value;
alert('The author of this website needs to read' +
'FAQs and learn from them')
">
<option value=1>1
<option vlaue=2>2
<option value=3>3
.....
</select>

Naturally, un-tested.

Is "parameter" a reserved word?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.