I am trying to add a custom validation function to an existing form. I am using hook_form_FORM_ID_alter()
to edit the form. I am then adding a new function to the #validation array. When I use dpm()
and print out $form['#validation']
I can see that my function is there. However the validation step is not running. If I dpm()
in the validation function it is not hit.
/** * Implements hook_form_FORM_ID_alter(). */ function mymodule_form_mycustomdorm_form_alter(&$form, &$form_state, $form_id) { $form['#validate'][] = 'mymodule_test'; dpm($form['#validate']); } function mymodule_test($form, &$form_state) { dpm($form_state); }