473,803 Members | 3,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem With Request.Form

I am trying to use Request.Form to differentiate between when a page
containing a form is first loaded and when it is reloaded as a result of the
user clicking on the Submit button. Things are not working as expected. Some
snippets of my code are:

fSubmit = Request.Form("S ubmit1") = "Process"
Response.Write( "Submit1 " & Request.Form("S ubmit1") & "<br>")
Response.Write( "fSubmit: " & fSubmit & "<br>")
......

<form <%=Request.Serv ervariables("UR L")%> method=post Name="cktlogin" >
<b>Authorizatio n Code: </b><Input Type="PASSWORD" Name="pw" Size="15"
Maxlength="15" Value="">
<p>
<INPUT NAME="Submit1" TYPE=Submit Value="Process" >
</form>

I expected that the value of Request.Form("S ubmit1") would contain
"Process" only after the user clicks on the Submit button but it is set to
that value as soon as the page loads the first time?

What is the correct way to determine if the Submit button was clicked?

TIA

Wayne
Jul 19 '05 #1
5 1631
if Request.Form("S ubmit1") = "Process" then
CODE WHEN FORM IS SUBMITTED
end if

<form.......... .>

FORM STUFF

</form>
"Wayne Wengert" <wa************ ***@wengert.com > wrote in message
news:e4******** ******@tk2msftn gp13.phx.gbl...
I am trying to use Request.Form to differentiate between when a page
containing a form is first loaded and when it is reloaded as a result of the user clicking on the Submit button. Things are not working as expected. Some snippets of my code are:

fSubmit = Request.Form("S ubmit1") = "Process"
Response.Write( "Submit1 " & Request.Form("S ubmit1") & "<br>")
Response.Write( "fSubmit: " & fSubmit & "<br>")
.....

<form <%=Request.Serv ervariables("UR L")%> method=post Name="cktlogin" >
<b>Authorizatio n Code: </b><Input Type="PASSWORD" Name="pw" Size="15"
Maxlength="15" Value="">
<p>
<INPUT NAME="Submit1" TYPE=Submit Value="Process" >
</form>

I expected that the value of Request.Form("S ubmit1") would contain
"Process" only after the user clicks on the Submit button but it is set to
that value as soon as the page loads the first time?

What is the correct way to determine if the Submit button was clicked?

TIA

Wayne

Jul 19 '05 #2
Alex;

Thanks for the response but that is basically what I am doing. The statement
fSubmit = Request.Form("S ubmit1") = "Process"

should set fSubmit to False unless the button has been clicked (I thouight!)

When I load the page the Response.Write statements show that
Request.Form("S ubmit1") has the value "Process" before the button has been
clicked?

Wayne

"Alex Goodey" <ag*****@hsfina ncial.co.uk> wrote in message
news:bu******** ****@ID-221525.news.uni-berlin.de...
if Request.Form("S ubmit1") = "Process" then
CODE WHEN FORM IS SUBMITTED
end if

<form.......... .>

FORM STUFF

</form>
"Wayne Wengert" <wa************ ***@wengert.com > wrote in message
news:e4******** ******@tk2msftn gp13.phx.gbl...
I am trying to use Request.Form to differentiate between when a page
containing a form is first loaded and when it is reloaded as a result of

the
user clicking on the Submit button. Things are not working as expected.

Some
snippets of my code are:

fSubmit = Request.Form("S ubmit1") = "Process"
Response.Write( "Submit1 " & Request.Form("S ubmit1") & "<br>")
Response.Write( "fSubmit: " & fSubmit & "<br>")
.....

<form <%=Request.Serv ervariables("UR L")%> method=post Name="cktlogin" >
<b>Authorizatio n Code: </b><Input Type="PASSWORD" Name="pw" Size="15"
Maxlength="15" Value="">
<p>
<INPUT NAME="Submit1" TYPE=Submit Value="Process" >
</form>

I expected that the value of Request.Form("S ubmit1") would contain
"Process" only after the user clicks on the Submit button but it is set to that value as soon as the page loads the first time?

What is the correct way to determine if the Submit button was clicked?

TIA

Wayne


Jul 19 '05 #3
> When I load the page the Response.Write statements show that
Request.Form("S ubmit1") has the value "Process" before the button has been clicked?


I'm totally confused. How do you have a request.form collection, if you
haven't submitted the form? In other words, if the button *hasn't* been
clicked, then the form hasn't even been submitted.
Jul 19 '05 #4
I am equally confused for the same reason! I have never seen anything like
this. I expected the Request.Form values to be populated only after I
pressed the submit key. That is not happening?

Wayne

"Aaron Bertrand [MVP]" <aa***@TRASHasp faq.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
When I load the page the Response.Write statements show that
Request.Form("S ubmit1") has the value "Process" before the button has

been
clicked?


I'm totally confused. How do you have a request.form collection, if you
haven't submitted the form? In other words, if the button *hasn't* been
clicked, then the form hasn't even been submitted.

Jul 19 '05 #5
Learned something - I cleared all cookies and cached pages and that seemed
to let things work as expected. I really don't understand why that affects
things but...

I'll keep experimenting!

Wayne

"Aaron Bertrand [MVP]" <aa***@TRASHasp faq.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
When I load the page the Response.Write statements show that
Request.Form("S ubmit1") has the value "Process" before the button has

been
clicked?


I'm totally confused. How do you have a request.form collection, if you
haven't submitted the form? In other words, if the button *hasn't* been
clicked, then the form hasn't even been submitted.

Jul 19 '05 #6

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

Similar topics

7
2225
by: Christopher Brandsdal | last post by:
Hi! I have a problem running my code on 2000 server and iis5.0. The code runs perfectly on my localhost (xp iis5.1) but when i run it on 2000 server iis5.0 I get this error: -------------------------------------- operation must use an updateable query
3
3536
by: wk6pack | last post by:
Hi, I have an asp page that I would like to do paging. The problem I'm running into is that the same page that prints to the output is also recieving data from the previous page for query parameters for the sql string. When I click on the next page, it queries itself and loses all the query parameter information from the parameter page and brings back all the records.
1
2416
by: Techy | last post by:
I have hancoded the asp page for inserting the values into an Ms Access > Database and it work fine > > The problem I am facing is that once I insert any value with Decimals like " > 11.95" or 222.02 or 227.021 it is either rounding it up or taking only the > numbers before the decimals. > > I want to keep these values as it is exactly entered through the form, so > that while I retrieve the data inserted I want the values to have
2
4028
by: Kingdom | last post by:
I have a SelectBoxes.asp page that is working with multiple selection dropdown boxes to extract data and total the selection prices. Tom & Bob were kind enough to give me a big help getting this page working and it's working just fine, no problems with this page. However I then would like this data e-mailed using jmail (my host insists on this method) and that is the function of the sendEMail2.asp page. This is failing and only giving...
2
1753
by: Harag | last post by:
Hi All Using: JScript IIS 5 I have a problem in the following code: // The next 4 lines display exactly what was typed in the text boxes. out("<br>Request.Form="+ Request.Form("Box1").Item); out("<br>Request.Form="+ Request.Form("Box2").Item);
5
569
by: fripper | last post by:
I posted this problem a couple of days ago but felt I might have better luck re-stating the problem. Apparently I messed up IIS (v. 5) somehow because I am suddenly unable to load web forms! A simple example will help. I created a simple web project that contains two simple forms ... WebForm1 and WebForm2. WebForm1 has a button which when clicked simply does a Response.Redirect("WebForm2.aspx"). When I run the program and click the...
4
5606
by: Jack | last post by:
Hi, I have a asp page where part of the code is as follows. This builds up the sql statement partially. sql01 = "UPDATE EquipmentTbl SET " sql01 = sql01 & "SerialNumber = '" & request.form(strSerialNum) & "', " sql01 = sql01 & "Description = '" & request.form(strDesc) & "', " sql01 = sql01 & "Location = '" & request.form(strLoc) & "', "
5
3208
by: jmartmem | last post by:
Greetings, I have built an Update Record Form in an ASP page. This form contains a number of fields, such as text boxes and menus, to name a few. Upon clicking the 'submit' button, I want the form values to pass to a confirmation page that shows the values entered and selected, with a CDONTS auto email generated at the same time. My problem is that I'm having trouble passing the values from the form to both the confirmation page and the...
5
3432
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi Guys, It's been a while, I've got a small problem that I could do with your expertise on. As you know (I Think) I build websites for recruitment agencies, part of the website includes a job board facility and for job form entry I used a normal form with a normal textbox, however what I'm finding now is that a lot of recruitment consultants are pasting the job description into the textbox, which when submitted is resulting in most of...
23
3603
by: ryna | last post by:
Desperately need help.... here's the snippet of my code that im trying to solve since last week... icePayment.aspx If (Left(Request.Form("return_url"), 7) <> "http://") Then errorInput = errorInput & "Invalid return URL path! <BR>" errorExist = True Response.Redirect("InvalidUrlError.aspx")
0
9700
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9564
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,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6841
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
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
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.