Search code examples
phpdrupaldrupal-fapi

Showing form data after submit


I have a form with a submit button and a handler that stores data in the database. Problem is when the form is submitted, all data is cleared from the input fields. Is there a way to still show them after submit? What changes do I need to make to my form_submit function?

function mymodule_form_submit($form, &$form_state) {
 //how to retain the input in the form
}

I'm looking for the most "drupalish" way to get this done?


Solution

  • As indicated by this previous StackOverflow question you can accomplish this with $form_state['storage'] and $form_state['rebuild'].