Closed Bug 274571 Opened 20 years ago Closed 20 years ago

Disabled form element values are not passed to CGI scripts (actually PHP pages)

Categories

(SeaMonkey :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: init, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031030 Galeon/1.3.13
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031030 Galeon/1.3.13

When I use the 'disabled' attribute of form input elements, the value of these
elements are not passed on to the server when I submit the form. I would like
the 'disabled' attribute to just stop the user from manipulating the element
value, but I still would like the value to be passed on to the server. This has
been confirmed for at least checkboxes and text input fields. Example:

I am working on a web business system for my employer. On one page, the user can
add entries to an invoice. The entries, among others, contain amount and price
fields, as well as a sum field. I use a Javascript to compute sum = amount*price
 and sets the sum text input box to disabled to disable the user from changing
the value in the box after it has been computed. But when I submit the form, the
sum value is not submitted, and thus, not available in the PHP script.


Reproducible: Always

Steps to Reproduce:
1. Create a form with a disabled, but checked, checkbox.
2. Submit the form to a CGI script that evaluates the form.


Actual Results:  
This CGI script does not get any information about the disabled checkbox, it is
just as it wasn't there.



Expected Results:  
Submit the checkbox just like an enabled checkbox. The 'disabled' attribute
should just apply to the user at the web page, i.e. a disabled checkbox should
act like an enabled checkbox except that it prevents the user from changing its
state.
(In reply to comment #0)
> i.e. a disabled checkbox should
> act like an enabled checkbox except that it prevents the user from changing its
> state.

No, it shouldn't. quoting Bill Mason in bug 154145 comment 2:
>This is correct according to the HTML spec, which states that:
>
>"When set, the disabled attribute has the following effects on an element:
>    * Disabled controls do not receive focus.
>    * Disabled controls are skipped in tabbing navigation.
>    * Disabled controls cannot be successful."
>
>Successful is defined as "'valid' for submission".  So if an element is
>disabled, it cannot be successful/valid for submission and therefore should not
>be submitted.
>
>References:
><http://www.w3.org/TR/html4/interact/forms.html#adef-disabled>
><http://www.w3.org/TR/html4/interact/forms.html#successful-controls>


--> this bug is invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.