return message after hook_form_submit without Ajax This might seem trivial to many of you, but how can you return a form with a customized message (according to the fields) in a hook_form_submit ? Like :

   &lt;?php
/**
 * @file
 * Pages and display.
 */
/**
 * Constantes
 */

/**
 * *************** Formulaire *******************
 */

/**
 * 
 * Implements a standard form.
 */
function MY_MODULE_form($form, $form_state, $arg) {
  $form = array ();
  $form ['#type'] = 'type';
  /**
   * All the form elements
   */

  // soumission du formulaire
  $form ['submit'] = array (
      '#type' =&gt; 'submit',
      '#value' =&gt; t ( 'Lancer la simulation' ),
      '#weight' =&gt; 10000 
  );

  $form ['simul_message_retour'] = array (
      '#prefix' =&gt; '&lt;div id="result-div"&gt;',
      '#suffix' =&gt; '&lt;/div&gt;',
      '#markup' =&gt; isset($form_state ['input']['simul_message_retour']['#markup'])?$form_state ['input']['simul_message_retour']['#markup']:'',
      '#weight' =&gt; $form ['submit'] ['#weight'] + 1 
  );
  if (!empty($form_state['response_module'])) { 
    $form['simul_message_retour']['#markup'] = convert_data_to_markup($form_state['response_module']);
  }
  return $form;
}

/**
 * Validation Works
 */
function MY_MODULE_form_validate($form, &amp;$form_state) {

  $form_numbers = array (
    //Some form fields
  );
  // operations of validation
}

/**
 *
 * @param unknown $form_element          
 * @param unknown $form_state          
 * @return Ambigous &lt;multitype:, unknown&gt;
 */
function MY_MODULE_format_simul_datenaissance($form_element, &amp;$form_state) {
  //checking some of the form construction
}
/**
 * Function of submit
 *
 * @param unknown $form          
 * @param unknown $form_state          
 */
function MY_MODULE_form_submit($form, $form_state) {
  $form_state['response_module'] = project_call_WS($form, $form_state);
  $form_state['rebuild'] = TRUE;
}

/**
 * function processing the call to the WS
 * @param unknown $form          
 * @param unknown $form_state          
 */
 function project_call_WS($form, $form_state){
  // checking if there are no errors
  if (form_get_errors ())
    return '';

  //Operations on the form
  $url = implode ( '/', $url_array );
  $parameters = 'URLTOWEBSERVICE';
  // HERE IS CALLED THE WEBSERVICE(the function call_ws is working well)
  $call = call_ws ($parameters );


  $build = array (
      //ETC
  );
 //Operations on the $builds array
  return $build;
}


Thanks a lot
The form API and message system are not the same thing, even though there are helper functions in the FAPI to produce messages - you don't return a form with a message, you set a message when it's appropriate to do so. That might be when the form is being built, when it's being validated, after it's been submitted, and so on.

Generally speaking, if you're setting a validation error, use form_set_error() in a validate callback:

function MYMODULE_form_validate(&amp;$form, &amp;$form_state) {
  if (something_wrong_with($form_state['values']['foo'])) {
    form_set_error('foo', 'Run away, bad things happening');
  }
}


If you want a confirmation message on form submission, use drupal_set_message() in a submit callback:

function MYMODULE_form_submit($form, &amp;$form_state) {
  if ($form_state['values']['foo'] == 'bar') {
    drupal_set_message(t('You chose: %foo', array('%foo' =&gt; $form_state['values']['foo'])));
  }
}


There's no point returning anything from a form submit callback - it will be ignored. If you want to rebuild the same form again after submission, use:

$form_state['rebuild'] = TRUE;


It may or may not be necessary depending on your final goal.