[support] Doubts on argument passing

Austin Einter austin.einter at gmail.com
Mon Apr 11 09:52:26 UTC 2011


Hi All
I have a form. Form contains a text field and a search button.

When user clicks search button, I redirect to a page
"resume_search/skill_based_search"

Corresponding hook_form code.

 $form['search']['skill'] = array(
 '#type' => 'textfield',
 '#title' => t('Enter skill set'),
 '#required' => FALSE,
 '#description' => "Example:  PHP, HTML, MySQL, VoIP, SNMP",
 '#size' => 50,
 '#maxlength' => 256,
 );

 $form['submit'] = array(
 '#type' => 'submit',
 '#value' => 'Search',
 '#submit' => array('resume_search_submit'),
 );

Corresponding hook_menu() code

 $items['resume_search/skill_based_search'] = array(
 'title' => t('Search Result'),
 'page arguments' => array(1),
 'page callback' => 'resume_search_skill_based_search',
 'access arguments' => array('access content'),
 'type' => MENU_CALLBACK,
 );

 function resume_search_submit($form, &$form_state)
 {
  $form_state['redirect'] = 'resume_search/skill_based_search';
 }

So from above code, when user clicks search button,
resume_search_skill_based_search() is called and the page "
http://localhost/livejobs1/?q=resume_search/skill_based_search" comes up.
I want inside resume_search_skill_based_search(), the text entered by user
in search textfield should be available.

I know, we need to pass the aguguments, but not clear how do I do this. Can
somebody give me a high level input how data entered in a textfield is
available in another page.

Best Regards
Austin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110411/0f572b8a/attachment.html 


More information about the support mailing list