[eluser]bonguoita[/eluser]
Hi all, I am very new to CI.
I have 2 fields need to validate: username and password. Both of them must be required.
How can I set a differ error message for each field?
For example, when username is empty, error message is : "Username must have"
and password is empty, error message is : "Password must have"
Now I only know to do this:
Code:
$customMessage = 'This is custom error message for required rule';
$this->validation->set_message('required', $customMessage)
And the string $customMessage always appear whenever a field is empty regardless it's username or password.
Please help me. Thank you!