After #426056: Server-side enforcement of #disabled is inconsistent, any disabled field is no longer passed to the server. This creates a problem with using #states that alter the 'enabled'/'disabled' states of an element.

According to the comments in that issue, the recommended solution is to un-disable with Javascript all the elements which were disabled via a #states action, on submission.

This needs to be address as soon as possible or the FAPI #states will not be very useful for real sites.

João

Comments

jcnventura’s picture

Priority: Major » Minor
Status: Active » Needs review
StatusFileSize
new1.25 KB

I did some work on it... It didn't solve the problem and thinking about it, this is really a problem of the 'readonly' attribute not being properly supported by the browsers (see #900590: Support for the readonly/readwrite attribute).

If we're marking it disabled, then it really should be disabled, and we're not interested in the value of that field. To grey it so that it can't be changed, but still receive its value on form submission is what the readonly attribute is designed for.

Anyway, here is the patch I was working on, as it may prove useful for something..

damien tournoud’s picture

Status: Needs review » Closed (won't fix)

If a field is disabled, by definition you don't care about its value.