I'm trying to reuse the login form in my own form. So far so good, everything is populated and shown properly. Now I want to use my validation functions to validate some data, so I tried to add them:
$userLogin = drupal_get_form('user_login');
array_unshift($userLogin['#validate'], 'MY_UBERLEAD_FUNC_validate');
$form['selfservice_ad_tabs']['tab_3']['login'] = $userLogin;
Printing the form shows that the function is in the proper place, but it was not invoked when expected.
I tried several other methods:
$userLogin['actions']['submit']['#validate'][] = 'MY_UBERLEAD_FUNC_validate';
also removing all validation handlers and leaving just mine, but those didn't work either.
Can somebody point what i am doing wrong or explain how i can reuse existing form into my custom form using my validation functions.
Thanks in advance!