write link from selection

Q

quickcur

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
 
R

Randy Webb

(e-mail address removed) 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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top