473,396 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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("Submit1") = "Process"
Response.Write("Submit1 " & Request.Form("Submit1") & "<br>")
Response.Write("fSubmit: " & fSubmit & "<br>")
......

<form <%=Request.Servervariables("URL")%> method=post Name="cktlogin">
<b>Authorization 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("Submit1") 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 1612
if Request.Form("Submit1") = "Process" then
CODE WHEN FORM IS SUBMITTED
end if

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

FORM STUFF

</form>
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:e4**************@tk2msftngp13.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("Submit1") = "Process"
Response.Write("Submit1 " & Request.Form("Submit1") & "<br>")
Response.Write("fSubmit: " & fSubmit & "<br>")
.....

<form <%=Request.Servervariables("URL")%> method=post Name="cktlogin">
<b>Authorization 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("Submit1") 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("Submit1") = "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("Submit1") has the value "Process" before the button has been
clicked?

Wayne

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

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

FORM STUFF

</form>
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:e4**************@tk2msftngp13.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("Submit1") = "Process"
Response.Write("Submit1 " & Request.Form("Submit1") & "<br>")
Response.Write("fSubmit: " & fSubmit & "<br>")
.....

<form <%=Request.Servervariables("URL")%> method=post Name="cktlogin">
<b>Authorization 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("Submit1") 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("Submit1") 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***@TRASHaspfaq.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
When I load the page the Response.Write statements show that
Request.Form("Submit1") 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***@TRASHaspfaq.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
When I load the page the Response.Write statements show that
Request.Form("Submit1") 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
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: ...
3
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...
1
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...
2
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...
2
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="+...
5
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...
4
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 = '" &...
5
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...
5
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...
23
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 =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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 project—planning, coding, testing,...

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.