Empty a field when it is disabled I am using #state values in a hook_form_alter() to disable field_2 if field_1 (a checkbox) is checked. It works and all is good.

Now I want to empty field_2 as well. I cannot see a way to do that with the #state. 

How can I make sure that values don't get saved for fields that are conditionally disabled, even if the user enters a value first?
Interesting question. Since the $form_state variable is passed by reference to all form validation &amp; submit handlers, you can modify it prior to it reaching the submit handler that saves it. What about adding a new validation handler that will empty the $form_state['values']['field_2'] value if the field is disabled in $form? That should ensure that the field is empty by the time anything tries to save it.