1

I created a new module to extend the webform module for custom submission hooks:

function mywebform_extra_form_alter(&$form, &$form_state, $form_id) {
    if ($form_id == 'webform_client_form_213') {
        $first = array_shift($form['#submit']);
        array_unshift($form['#submit'], $first, 'mywebform_extra_submit_213');
    }
}

I have the webform module installed and I created a webform that has a node id of 213.

When I try to output the $form_id variable, the value shown is nothing indicative of a webform and instead showing "search_form_block" as the form ID?

what is the error here? I pulled it straight from this example.

1 Answer 1

1
  1. Install the Devel module.

  2. Use the dpm() function, it will print out $form_id for all forms on any page you visit.

    function mywebform_extra_form_alter(&$form, &$form_state, $form_id) {
      dpm($form_id);
    }
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.