[eluser]CARP[/eluser]
Hi guys
I've been trying to replace default error messages when validating my forms, but I cannot get it to work.
After searching in forums, I see that the set_message function is called when using callback functions (custom validation routines) but I won't create 1 custom callback routine for just displaying my custom error message
This is my code
Code:
$rules['usernamefield'] = 'trim|required';
$rules['emailfield'] = 'trim|required';
$this->validation->set_message($rules['usernamefield'], 'You must fill this field!');
$this->validation->set_message('usernamefield', 'You must fill this field!');
$this->validation->set_rules($rules);
$this->validation->set_error_delimiters('<span class="error">', '</span><br />');
$fields['usernamefield'] = 'Your Username';
$fields['emailfield'] = 'Your Email address';
$this->validation->set_fields($fields);
but this line
Code:
$this->validation->set_message($rules['usernamefield'], 'You must fill this field!');
nor this one
Code:
$this->validation->set_message('usernamefield', 'You must fill this field!');
aren't working
Should I use set_message only when using callback custom validation functions?
Thanks a lot in adv.