I have an element with set #element_validate (in hook_element_info) and I use this element in a custom form. The problem is that when I try to add an additional #element_validate to the element in the form it overrides the original validate callback (the one set in hook_element_info).
So my question is, is there any way how to add an additional #element_validate in a custom form without having to use form_alter?
'ELEMENT_NAME' => array( '#input' => TRUE, '#tree' => TRUE, '#process' => array(..), '#element_validate' => array('original_validate'), ),
$form['TST'] = array( '#type' => 'ELEMENT_NAME', ... ); $form['TST']['#element_validate'] = 'new_validate';
And then only new_validate is present when on 'process' callback of the element (as well as when the form is build). When I don't set the 'new_validate' the 'original_validate' is still present on 'process'.
Other elements (tried a few date ones) seem to behave the same way. E.g. #element_validate added in form declaration overrides the own element's one defined in hook_element_info.