"Rabel" <Ra***@Creativeness.comwrote in message
news:11**********************@w1g2000hsg.googlegro ups.com...
On Apr 4, 1:08 pm, "Marc" <sorry...@dirtymail.comwrote:
"Marc" <sorry...@dirtymail.comwrote in message
news:eT**************@TK2MSFTNGP03.phx.gbl...
"Rabel" <R...@Creativeness.comwrote in message
news:11*********************@w1g2000hsg.googlegrou ps.com...
>I am new to asp and I am having a little trouble with the Request.form
option. What I want to do is I have a dropdown box.
<select name="selecter" class="text" id="selecter">
<option value="page1.htm" selected>Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option>
</select>
and I want to use a button that then will take you to the page you
selected so I have been trying codes like this.
<a href="<%= Request.Form("selecter") %>" ><img src="submit.jpg"
width="45" height="18" border="0"></a>
Any idea what I am doing wrong, any help is apprieciated.
Thanks,
Randy
I think you want to try javascript for that but...
<%
Response.Redirect(Request.Form("selecter"))
%>
I can't help myself:
<select name="selecter" class="text" id="selecter"
onchange="if(this.selectedIndex>0)document.locatio n.href=this.options[this.*selectedIndex].value">
<option value="" selected>Select page</option>
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option>
</select>
Make sure the "onchange" bit until the ">" is on one line!- Hide quoted
text -
- Show quoted text -
Thanks Marc - but is there a way that I can still use a button then
just when you select from the box.
Thanks
sure, but remember... this isn't a javascript group.
<form name="frm">
<select name="selecter" class="text" id="selecter">
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option>
</select>
<input type="button" value="go there"
onclick="document.location.href=document.frm.selec ter.options[document.frm.selecter.selectedIndex].value"
/>
</form>