[eluser]Multisnet[/eluser]
Hello,
I have a set of validation rules in a config file (like this):
Code:
$config = array(
'registoPaciente'=>array(
array(
'field' => 'nome',
'label' => $CI->lang->line('form_campo_nome'),
'rules' => 'required|alpha|callback_vnome'
),
array(
'field' => 'apelido',
'label' => $CI->lang->line('form_campo_apelido'),
'rules' => 'required|alpha'
),
array(
'field' => 'sexo',
'label' => $CI->lang->line('form_campo_sexo'),
'rules' => 'required'
),
(...)
)
In my controller, inside a callback function for a specific field I want to run validation rules of another field.
Is it possible? How?
Some more explanation: In the callback my aplication access to an external webservice to perform some additional validation, as this service has a big delay I only want to execute it if the other field is valid
I hope you understand my problem.
Thanks in advance..
UPDATE:
I forgot to say that I solved this problem repeating the rules in my controller. However I really don't appreciate this solution, because in the future someone could update the config rules!