[eluser]Thimuth[/eluser]
Hi,
I need to set custom error messages in my form validations and i did it as follows.
eg:
Code:
$rules['Username'] = "trim|alpha_numeric";
$this->validation->set_message('alpha_numeric',' Username should contain only letters and numbers');
$rules['Password'] = "trim|alpha_numeric";
$this->validation->set_message('alpha_numeric',' Password should contain only letters and numbers.Please resend Password.');
$this->validation->set_rules($rules);
$fields['Username'] = "Username";
$fields['Password'] = "Password";
$this->validation->set_fields($fields);
But in here, when there's an alpha_numeric error with the Username field, it returns the error defined for the password field.
It seems Username's error had been overwritten by the Password's error.
Need a solution to define custom messages for same error validation for multiple field.
Thanks.