By spflanze on
I need to execute a PHP function to do database operations when the user leaves the form to go to another. The function must get an up to date $form_state object that reflects the state of the form at the time the user leaves. This is so any input the user has done before leaving will go to the database and not be lost. For this form I cannot count on the user to remember to always click on a submit button before leaving to save the user's work and so I want the user not to have to.
How can this be done?