I'm trying to add a custom validation step to the themed signup form, but as far as I can tell, my validation call back isn't getting called (for testing, I've hardwired it to set an error if it's called, and signups are going through without an error).

To call the validation call back, I have put this line in the bottom of theme_signup_user_form, immediately before return $form
$form['#validate']['signup_form_data'] = 'theme_signup_user_form_validate';

Should this work, or do I need to do this another way?

Thx,

Ellen

Comments

awolfey’s picture

You need to do this in a custom module with hook_form_alter() for form with id == signup-form:

$form['#validate'][] = 'mymodule_signup_validation';

Then do your validation in

function mymodule_signup_validation(&$form, &$form_state) {
do stuff;
}

joachim’s picture

Status: Active » Closed (fixed)

Going to mark this as closed as the question's been answered.

This may also be of interest: #29568: Flexible number and type of fields.