Filling form with user entered values after submit How do I fill a custom form with the values entered from the users before the form was submitted? I have saved the $form_state values, but when I put them back into $form_state on loading, the form fields aren't filled.
Drupal 7

If you are not redirecting and want to preserve the values in the Form API fields add $form_state['rebuild'] = TRUE; on the submit handler.

/**
 * FORM submit handler.
 */
function FORM_form_submit($node, &amp;$form_state) {
  // Rebuild the form and keep the filter values.
  $form_state['rebuild'] = TRUE;
}




Drupal 8

In Drupal 8 you would use $form_state-&gt; setRebuild(); 

See public function FormState::setRebuild for more detail. 

Custom submit handlers in Drupal 8 are dealt with differently — here is some useful discussion on Drupal 8 submit handlers.