To allow for things like this:
//...
$form['myfield'] = array(
'#type' => 'textfield',
'#title' => 'My Field',
'#required' => TRUE,
'#rules' => array(
'length[10, 50]',
array(
'rule' => 'alpha_numeric',
'error' => 'Please, use only alpha numeric characters at %field with extra an extra %param.'),
'error params' => array(
'%param' => t('Some param'),
),
),
);
//...
This instead of passing dummy data in the field and adding an error callback to generate the error message manually. I think this is a relative easy addition to fapi_validation_rules_execute() with some nice extras :)
Comments
Comment #2
pedrofaria commentedGreat idea. I will port it to Drupal 8 version
Comment #3
astonvictor commentedI'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks
Comment #4
astonvictor commentedComment #5
astonvictor commented