Link to home
Create AccountLog in
Avatar of drupal_100
drupal_100Flag for United States of America

asked on

drupal form additional validate function

In user_login_block, I add an additional field CN (customer number), and I want to add an additional validate function for it.

$form['#validate'][] = 'additional_validate';
When I do this way, sometimes if I input the correct CN value, and incorrect password, it can pass and login with the
incorrect password there.

array_unshift($form['#validate'], 'additional_validate');  
When I do this way, it works well.
Given correct CN value, it will validate password and not login on incorrect password.

I often like to use $form['#validate'][] way.
Is there something incorrect here to use this way?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer