473,785 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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 1717
"Rabel" <Ra***@Creative ness.comwrote in message
news:11******** *************@w 1g2000hsg.googl egroups.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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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.Redire ct(Request.Form ("selecter") )
%>


Apr 4 '07 #2
"Marc" <so******@dirty mail.comwrote in message
news:eT******** ******@TK2MSFTN GP03.phx.gbl...
"Rabel" <Ra***@Creative ness.comwrote in message
news:11******** *************@w 1g2000hsg.googl egroups.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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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.Redire ct(Request.Form ("selecter") )
%>
I can't help myself:

<select name="selecter" class="text" id="selecter"
onchange="if(th is.selectedInde x>0)document.lo cation.href=thi s.options[this.selectedIn dex].value">
<option value="" selected>Select page</option>
<option value="page1.ht m">Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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...@dirty mail.comwrote:
"Marc" <sorry...@dirty mail.comwrote in message

news:eT******** ******@TK2MSFTN GP03.phx.gbl...
"Rabel" <R...@Creativen ess.comwrote in message
news:11******** *************@w 1g2000hsg.googl egroups.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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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.Redire ct(Request.Form ("selecter") )
%>

I can't help myself:

<select name="selecter" class="text" id="selecter"
onchange="if(th is.selectedInde x>0)document.lo cation.href=thi s.options[this.*selectedI ndex].value">
<option value="" selected>Select page</option>
<option value="page1.ht m">Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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***@Creative ness.comwrote in message news:11******** *************@w 1g2000hsg.googl egroups.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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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...@Creativen ess.comwrote in messagenews:11* *************** *****@w1g2000hs g.googlegroups. 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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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***@Creative ness.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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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.For m("selecter") ) 0 then
Response.Redire ct(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***@Creative ness.comwrote in message news:11******** **************@ n59g2000hsh.goo glegroups.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...@Creativen ess.comwrote in messagenews:11* *************** *****@w1g2000hs g.googlegroups. 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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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***@Creative ness.comwrote in message
news:11******** **************@ w1g2000hsg.goog legroups.com...
On Apr 4, 1:08 pm, "Marc" <sorry...@dirty mail.comwrote:
"Marc" <sorry...@dirty mail.comwrote in message

news:eT******** ******@TK2MSFTN GP03.phx.gbl...
"Rabel" <R...@Creativen ess.comwrote in message
news:11******** *************@w 1g2000hsg.googl egroups.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.ht m" selected>Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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("s electer") %>" ><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.Redire ct(Request.Form ("selecter") )
%>

I can't help myself:

<select name="selecter" class="text" id="selecter"
onchange="if(th is.selectedInde x>0)document.lo cation.href=thi s.options[this.*selectedI ndex].value">
<option value="" selected>Select page</option>
<option value="page1.ht m">Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">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.ht m">Page 1</option>
<option value="page2.ht m">Page 2</option>
<option value="page3.ht m">Page 3</option>
</select>
<input type="button" value="go there"
onclick="docume nt.location.hre f=document.frm. selecter.option s[document.frm.se lecter.selected Index].value"
/>
</form>

Apr 4 '07 #9

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

Similar topics

9
6511
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" labelProperty="value"/> In this case "key" is what I mean by "ID", and "value" is what I mean by "Value" -- the "Value" is shown to the user, but the "ID" is what I plan to keep, to be saved to a database (as a reference in a table to a common table as a part of...
1
2589
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 access the recordset it displays the results, what the real issue is that the entry is not made into the database even though i use the Update command and i have also tried the BeginTrans and CommitTrans nothign seems to work and i am unable to...
2
2458
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 appreciated.... Here is the asp file <HTML> <HEAD> <TITLE>File Upload Results</TITLE>
6
3807
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 one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
3
5006
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 : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
0
1716
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 someVariable = Request.Form) My problem is that the app doesn't allow input of non-ASCII data in the form. To resolve this I have replace the ContentType from "application/x-www-form-urlencoded" to "multipart/form-data".
2
1282
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 search for the first time, everything works perfectly. If I make any changes to the controls in the form and resubmit the page, nothing changes. That is, viewing the querystring, not a single value is altered despite my doing so in the form itself....
5
6763
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 link buttons to stay wired up to their click events. I have what is basically a simply survey question generation page. The page first displays a few static fields and a dropdownlist of various options for the user to select. When the user...
3
2213
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 that are SELECT elements (javascript-- one named arrivalcity and one named returncity). Basically they ask for a departure and return city and another menu appears with options based on that city. I can't seem to get the input from these fields in the...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9483
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10096
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.