How to identify disabled fields in form submit handler? I have a pretty complex form, on which fields are getting enabled and disabled conditionally. I'm using JavaScript to do that without call to server for performance purposes.

How can I not save values from fields that are disabled? Some of the conditions are not entirely based on field values, but also on user's behavior on a form, so it is not possible to simply recreate logic in PHP.

Currently I'm emptying disabled fields before submit, and then testing if $form_state['values']['field'] is filled and $form_state['input']['field'] is empty. If so, I assume field also got disabled, as my script does not allow to submit empty enabled fields. This gives me workable approximation of what I need, but prevents me from implementing graceful degradation for no-js clients, so I need a better solution.
There's not really enough information in the question to provide a definitive answer but what I'd suggest is:


add one or more hidden fields to the form to hold state information
store values in the field(s) using javascript when the state of the form changes with user action
On the server side, use the value(s) from the hidden field(s) to represent the state of the form so you can employ them in validation logic.