In Drupal 6.25.
I am building a custom user registration form that needs to run some actions on an external service after properly passing default form validation but before creating a new user record in Drupal. So far I am doing the following:
function mbrusers_form_alter(&$form, &$form_state, $form_id){
if($form_id == "user_register"){
if($default_form_validation_passed){
$form['#validate'][] = 'mbrusers_infusionConnect_validate';
}
}
}
function mbrusers_infusionConnect_validate($form, &$form_state){
// Run actions on external service
if($error){
form_set_error("", "SET ERROR");
}
}
I feel like I'm overlooking something, but I haven't been able to figure out what to do. Maybe using validate is the wrong idea? Any help that sets me in the right direction is appreciated.