how to submit "disabled" form elements

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ittay Dror

    #1

    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
  • Andrew Urquhart

    #2
    Re: how to submit "disabled& quot; form elements

    Ittay Dror wrote:[color=blue]
    > 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.[/color]

    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


    Comment

    Working...