2

I am working on a module which is common for a number of forms. I need to pass the $form_id as a parameter to the submit handler and set the form values accordingly in the submit function.

function ppi_form_alter(&$form, &$form_state, $form_id){

  $form['#submit'][]="action_form_submit";

}

function action_form_submit($form, &$form_state) {
  //here I need to get the form_id of the form and form_set_value accordingly ... How can I know the form value?
}

Is there a way to know the form_id in form_submit ?

Thanks!

perpetual_dream
  • 1,046
  • 5
  • 18
  • 51

1 Answers1

2

Set it as a hidden field in the hook_form_alter(), and then use it as you would any other field in the submit handler

TCLopez
  • 46
  • 6