467,925 Members | 2,024 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

how to submit "disabled" form elements

Hi,

I have a form with various elements which, according to changes in
values become enabled or disabled.

The disabled elements are normally not submitted, but I wish they
were. How can I go about making elements appear to be disabled, but
still send them when the form is submitted.

Thanx,
Ittay
Jul 23 '05 #1
  • viewed: 11363
Share:
1 Reply
Ittay Dror wrote:
The disabled elements are normally not submitted, but I wish they
were. How can I go about making elements appear to be disabled, but
still send them when the form is submitted.


Disabled form controls are not submitted by design (in W3C speak: 'they
are not successful').

Your options (in my order of my personal preference):
1. Re-engineer the application logic to not need to send disabled form
controls to the client in the first place.
2. Hidden fields
3. Use 'readonly' instead
4. Hidden fields *and* disabled fields (may confuse the user if disabled
data ends up being submitted?)
5. CSS styled to appear as disable (user may still modify data and you
don't know what 'disabled' looks like on all browsers)
6. Javascript to re-enable disabled form controls before form submission
(inaccessible and unreliable)
--
Andrew Urquhart
- FAQ: www.jibbering.com/faq/
- Archive: www.google.com/groups?q=comp.lang.javascript
- Contact: www.andrewu.co.uk/contact/
- Employ me: Front/middle tier ASP developer with WAI & web standards
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jeremy Langworthy | last post: by
1 post views Thread by Kruse | last post: by
5 posts views Thread by Mark Hannon | last post: by
reply views Thread by Dana Epp | last post: by
1 post views Thread by Morten Plathe | last post: by
1 post views Thread by Lars Netzel | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.