473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request.form("max")

I can get the value on the form at the server side by using

Request.form("max")

when max field is disabled I dont get value. For GUI and business logic
purpose I have disabled some fields with the values, but when I update
Request.form does not return me anything for disabled fields.

How to read disabled fields at the server side
Mar 22 '06 #1
8 3064
abcd wrote:
when max field is disabled I dont get value. For GUI and
business logic purpose I have disabled some fields with
the values, but when I update Request.form does not return
me anything for disabled fields.

How to read disabled fields at the server side


You can't:
http://www.w3.org/TR/html401/interac...ssful-controls

One alternative is to use READONLY instead of DISABLED.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Mar 22 '06 #2
"abcd" <ab**@abcd.com> wrote:
I can get the value on the form at the server side by using

Request.form("max")

when max field is disabled I dont get value. For GUI and business logic
purpose I have disabled some fields with the values, but when I update
Request.form does not return me anything for disabled fields.

How to read disabled fields at the server side

If Not isEmpty(Request.Form("max")) Then
' there was a "max" parameter in this form
Else
' there was no "max" parameter in this form
End If

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
Mar 23 '06 #3
Tim Slattery wrote:
How to read disabled fields at the server side


If Not isEmpty(Request.Form("max")) Then
' there was a "max" parameter in this form
Else
' there was no "max" parameter in this form
End If


That's not quite the issue, Tim. By specification, a disabled element cannot
be successful. That means no name-value pair for that element in the request
(and hence, no corresponding item in the Request.Form collection). Absence
from the request does not signify absence from the form, however.

And indeed, he wants the value of that element. He wants it to show up in
the Request.Form collection. He just does not want to make it convenient for
the user to access that value directly.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Mar 23 '06 #4
Dave Anderson wrote on 23 mrt 2006 in
microsoft.public.inetserver.asp.general:
Tim Slattery wrote:
How to read disabled fields at the server side


If Not isEmpty(Request.Form("max")) Then
' there was a "max" parameter in this form
Else
' there was no "max" parameter in this form
End If


That's not quite the issue, Tim. By specification, a disabled element
cannot be successful. That means no name-value pair for that element
in the request (and hence, no corresponding item in the Request.Form
collection). Absence from the request does not signify absence from
the form, however.

And indeed, he wants the value of that element. He wants it to show up
in the Request.Form collection. He just does not want to make it
convenient for the user to access that value directly.


With clientside script he could enable the element onsubmit.

Not an ASP problem though, ASP cannot help here.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 23 '06 #5
"Dave Anderson" <GT**********@spammotel.com> wrote:
Tim Slattery wrote:
How to read disabled fields at the server side
If Not isEmpty(Request.Form("max")) Then
' there was a "max" parameter in this form
Else
' there was no "max" parameter in this form
End If


That's not quite the issue, Tim. By specification, a disabled element cannot
be successful.


I don't know what that sentence means.
That means no name-value pair for that element in the request
(and hence, no corresponding item in the Request.Form collection).
Yes, that's what my code tests for.
Absence from the request does not signify absence from the form, however.
Huh?
And indeed, he wants the value of that element. He wants it to show up in
the Request.Form collection. He just does not want to make it convenient for
the user to access that value directly.


If it's in the Request.Form collection, then it's been sent by the
client, and therefore the user had access to it. If you have data you
want to hide from the user entirely, you have to keep it on the
server, in the session object or a database or something.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
Mar 23 '06 #6
Tim Slattery wrote:
That's not quite the issue, Tim. By specification, a
disabled element cannot be successful.
I don't know what that sentence means.


17.13.2 Successful controls
A successful control is "valid" for submission.
Every successful control has its control name
paired with its current value as part of the
submitted form data set. A successful control
must be defined within a FORM element and must
have a control name.

However:
. Controls that are disabled cannot be successful
. If a form contains more than one submit button...

http://www.w3.org/TR/html401/interac...ssful-controls
Absence from the request does not signify absence from
the form, however.


Huh?


The form is forbidden from submitting some controls. That does not mean they
do not exist.

The form is a client-side construct. When it is submitted, an HTTP request
is sent. If the form method is POST, the HTTP request is given a POST
method, a Content-Type header of "application/x-www-form-urlencoded", a
Content-Length header and a set of name-value pairs. IIS parses the request
and builds a Request Object, which includes a Form Collection built from the
entirety of the HTTP request. When it sees the POST method, it converts
those name-value pairs into elements of the Request.Form Collection.

So the request and the form are two different things, while the Request
Object is yet a third. The form is not the Form Collection of the Request
Object.
If it's in the Request.Form collection, then it's been sent
by the client, and therefore the user had access to it.
By definition, yes.
If you have data you want to hide from the user entirely,
you have to keep it on the server, in the session object
or a database or something.


But I don't think he was trying to hide the controls from the user. He could
have used a hidden input for that. He may, for example, have a control that
is populated by script, but one that he wants the user to see. In that case,
READONLY is a more useful attribute than DISABLED.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Mar 23 '06 #7
Thanks folks.

W3 is right always and its drving the web protocols.

So considering that, at the end of the submit I am explicitely enabling the
required controls so that I get their values though they look disabled on
the form later.

thanks
.. Dave Anderson wrote:
Tim Slattery wrote:
That's not quite the issue, Tim. By specification, a
disabled element cannot be successful.


I don't know what that sentence means.


17.13.2 Successful controls
A successful control is "valid" for submission.
Every successful control has its control name
paired with its current value as part of the
submitted form data set. A successful control
must be defined within a FORM element and must
have a control name.

However:
. Controls that are disabled cannot be successful
. If a form contains more than one submit button...

http://www.w3.org/TR/html401/interac...ssful-controls
Absence from the request does not signify absence from
the form, however.


Huh?


The form is forbidden from submitting some controls. That does not
mean they do not exist.

The form is a client-side construct. When it is submitted, an HTTP
request is sent. If the form method is POST, the HTTP request is
given a POST method, a Content-Type header of
"application/x-www-form-urlencoded", a Content-Length header and a
set of name-value pairs. IIS parses the request and builds a Request
Object, which includes a Form Collection built from the entirety of
the HTTP request. When it sees the POST method, it converts those
name-value pairs into elements of the Request.Form Collection.
So the request and the form are two different things, while the
Request Object is yet a third. The form is not the Form Collection of
the Request Object.
If it's in the Request.Form collection, then it's been sent
by the client, and therefore the user had access to it.


By definition, yes.
If you have data you want to hide from the user entirely,
you have to keep it on the server, in the session object
or a database or something.


But I don't think he was trying to hide the controls from the user.
He could have used a hidden input for that. He may, for example, have
a control that is populated by script, but one that he wants the user
to see. In that case, READONLY is a more useful attribute than
DISABLED.

Mar 31 '06 #8
abcd wrote:
Thanks folks.

W3 is right always and its drving the web protocols.

So considering that, at the end of the submit I am explicitely
enabling the required controls so that I get their values though they
look disabled on the form later.


That will work, but I don't understand why you prefer that over READONLY.
Read-only controls are successful and can be programmatically manipulated.
They ARE ALREADY what you desire.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Mar 31 '06 #9

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

Similar topics

11
2240
by: Wayne Folta | last post by:
Two observations about PEP-315: 1. It's clever, addresses a definite "wart", and is syntactically similar to try/except. But it's syntax seems like an acquired taste to me. 2. It is a very...
8
2208
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP programming. I found something weird. Response.Write(Request("something")) It draws "None" when there's no value for something. Actually I expect "" instead of...
3
10035
by: Dave Hammond | last post by:
Hi All, This one is a bit bizarre. My understanding of "Access is denied" with respect to window.moveTo is that it results from a request which would move a portion of the window off screen. ...
0
4398
by: Peter | last post by:
When I issue call sqlj.install_jar('file:///f:/jars/mail.jar','MAIL'); I get the messages SQL4301N Java or .NET interpreter startup or communication failed, reason
3
3102
by: asognoth | last post by:
Hi... Does anybody have a clue how to solve this problem? the task is to change the following method in that manner that it draws the (calculated) image form left to right instead of from top...
13
3215
by: Fao | last post by:
Hello, I am having some problems with inheritance. The compiler does not not return any error messages, but when I execute the program, it only allows me to enter the number, but nothing else...
1
6441
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
1178
by: mohamed82 | last post by:
Hi all. in my project using the inet controls for down loading zip file from site at the time error will occur for "unable to complete ur request" i think it will happening for the download more than...
1
5437
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
0
7326
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
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
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...
0
7498
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...
0
5627
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,...
1
5053
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...
0
4707
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...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
418
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...

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.