I'm working on creating my first module and I'm off to a great start. Ran into a little roadblock and was trying to see if anyone could point me in the right direction of where to go from here. So far I've created the settings page for the module and have the module building a block with a form in it.

When the form is submitted I need it to go to a page specified in the settings of the module and process the form displaying the results. I think I've got everything set up correct so far but need to know how to process the results on the specified path. What the module will do on that page is take the input from the form and ping an external API to search then display those results onto a page.

Basically just needing some guidance if something does something similar to this I can look at or what the best way of going about this is.

Comments

nevets’s picture

You might look at the search module and how it sets up a form in a block.

kbasarab’s picture

I've got the form setup in a block. That wasn't bad. I'll take a look into the search module. I'm able to get it to pass to a page now using a menu_callback but still can't get access to the submitted form values. I was trying to use drupal_process_form but to no avail and was trying to print the $form_values from a form_submit hook.

I can get the form_id on the submit hook to work but not values.

function formname_form_submit($form_id,$form_values) {
  drupal_set_message(t('%values are here and %name',array('%values' => $form_id, '%name' => $form_values)));
  return ;   
}

----
Kevin Basarab
Mediacurrent