472,378 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 software developers and data experts.

Easy question - Trouble with Request.Form

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

Apr 4 '07 #1
8 1651
"Rabel" <Ra***@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"))
%>


Apr 4 '07 #2
"Marc" <so******@dirtymail.comwrote in message
news:eT**************@TK2MSFTNGP03.phx.gbl...
"Rabel" <Ra***@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!
Apr 4 '07 #3
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

Apr 4 '07 #4
You need to have a default value for your link until the user makes a selection

and

-- you either need an autopostabck on your selector which will then change the link value

or

-- you need to use javascript to change the link value based upon the user selection.



"Rabel" <Ra***@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

Apr 4 '07 #5
On Apr 4, 3:02 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
You need to have a default value for your link until the user makes a selection

and

-- you either need an autopostabck on your selector which will then change the link value

or

-- you need to use javascript to change the link value based upon the user selection.

"Rabel" <R...@Creativeness.comwrote in messagenews:11*********************@w1g2000hsg.goo glegroups.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- Hide quoted text -

- Show quoted text -
Thanks Jon but I dont really understand what you mean - I think that
you are describing Marc's js version which I am using but I would
still like to have a button make it go to the next page, not just when
you select a option in the dropdown box.

Apr 4 '07 #6
"Rabel" <Ra***@Creativeness.comwrote:
>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>
Looks OK at a glance. In order to use Request.Form, your form has to
have been POSTed, you cannot use method="get" if you're going to use
that. If you want that link to be in the same page as the select
group, then you have to rethink what you're doing. ASP is a
server-side platform, and the <%= tag in the <a href= HTML tag won't
work unless the form has been submitted and you're building a new
page.

It can be done in the same page, but it's done using client-side
Javascript (use a handler for the onChange event in the select group).
That being the case, it's off-topic in this group.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
http://members.cox.net/slatteryt
Apr 4 '07 #7
I guess it's not clear what you are trying to accomplish.

if you want the dropdownlist to send the user to another page, then on the post back, use

if len(Request.Form("selecter")) 0 then
Response.Redirect(Request.Form("selecter"))
end if
if you want to populate the clientside anchor to give the user a button, then use javascript to get the selected value from the
dropdownlist through the onchange event.


"Rabel" <Ra***@Creativeness.comwrote in message news:11**********************@n59g2000hsh.googlegr oups.com...
On Apr 4, 3:02 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
>You need to have a default value for your link until the user makes a selection

and

-- you either need an autopostabck on your selector which will then change the link value

or

-- you need to use javascript to change the link value based upon the user selection.

"Rabel" <R...@Creativeness.comwrote in messagenews:11*********************@w1g2000hsg.goo glegroups.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- Hide quoted text -

- Show quoted text -

Thanks Jon but I dont really understand what you mean - I think that
you are describing Marc's js version which I am using but I would
still like to have a button make it go to the next page, not just when
you select a option in the dropdown box.

Apr 4 '07 #8
"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>

Apr 4 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Russ Perry Jr | last post by:
I'm using "ID" and "Value" in the generic sense here... Let's say one page I had a <html:select> with a collection like this: <html:options collection="items" property="key"...
1
by: Anand | last post by:
Hi i am having trouble adding a recordset into the access database, the code seems to be working fine it passs and parses through all variables just fine without showing any errors and also when i...
2
by: Sean Dotson | last post by:
I have a form that passes variables to an asp file and then uploads a file. For some reason the request.form is not getting the info from the form. It's returning blanks. Any insight would be...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
0
by: scottf35 | last post by:
Hi, I am working on (read that - upgrading) an application. This application creates an HTTPWebRequest object, populates it with values which are then sucked out of the Request.Form object (eg...
2
by: Roshawn | last post by:
Hi, On my asp.net page I have an html form. I've set runat attribute to server and filled it with server controls. All settings are as I like them. So here's the problem: when I perform a...
5
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
3
by: ibeehbk | last post by:
Hi. I have a form made in xhtml. I test via vbscript to make sure none of the fields are empty and properly formatted (ie email). All the regular fields work. However, I have two drop down menus...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.