Interesting link about drupal multi-step forms loading twice problem.
I created a form using drupal's form api or FAPI. The form would load twice on the first submission. The first time the $form_state['storage'] goes empty and the second time is populated. I wanted to use $form_state to store some values and do some checks.
The problem starts when you want to use drupals validation mechanism, when you set rules in the _form_validate function, then the whole form gets loaded twice but the $form_state won't work because its empty and then populated, so any code you have in your form definition function will run twice.
The following link explains how to use $_POST to avoid your code to run twice.
Post new comment