Вывод результата работы формы на этой же странице, где и форма.


function myMod_form($form, &$form_state) {

if(!empty($form_state['temporary'])) {
$form['results'] = array(
'#type' => 'item',
'#markup' => $form_state['temporary'],
);
}

return $form;
}

function myMod_submit($form_id, &$form_state) {

$results = callSomeFunctionToGetResults();

$form_state['temporary'] = $results;
$form_state['rebuild'] = TRUE;

}

Категория: 
The code has been tested and works
Мультитег: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.