What you want to do is use something like $form_state['temporary']
in your myMod_submit
function. Set $form_state['temporary'] = $someValue
and rebuild your form. You also want your myMod_form
function to have a place holder for your data. When the form is loaded, simply check to see if your temp holder is populated. if it is then you know you have a result and display it.
See code below.
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;
...
}
i omitted all my code that would populated $results
but this should get you to where you need to go.
quick addition here.
I just realized that you wanted it to go to another page and not the same page. I believe in your myMod_submit
function you can use drupal_goto()
. pass it a url and also pass it some options. you can then parse out the options as your values in the other page. See drupal_goto. however, i haven't tested this option out.