Sorry- this seems like it should be such a simple thing to do, yet I haven't been able to find anything in the documentation that suggests how to do this.
I have a form that will typically sit in a menu on the right-hand block, which is used to perform a database search.
Clicking the submit button calls the _submit function, and then the jobsearcher_results() function. What I want to be able to do is access the form data from within jobsearcher_results().
Any help's appreciated. Am using Drupal 6.
<?php
function jobsearcher_form($form_state) {
$form= array(
'#action' => url('jobsearcher/results'), // jobsearcher_results()
'#id' => 'user_jobsearch_form',
'#validate' => user_jobsearch_default_validators(),
'#submit' => array('user_jobsearch_form_submit'),
);
// Other form controls here.
$form['form']['submit'] = array(
'#type' => 'submit',
'#value' => t('Search'),
);
return $form;
}
function jobsearcher_menu() {
$items = array();
$items['jobsearcher/results/'] = array(
'title' => 'Job Search Results',
'page callback' => 'jobsearcher_results',
'access arguments' => array('access jobsearcher content'),
'type' => MENU_CALLBACK
);
function user_jobsearch_form_submit($form, &$form_state) {
// Can access $form_state data here
}
function jobsearcher_results() {