Filling form with user entered values after submit
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.