Custom error message using CodeIgniter Form Validation
Right way of doing this is by passing a string format
$this->form_validation->set_message('is_unique', 'The %s is already taken');
So, then only we can able to get message like "This Username is already taken"
or "This Email is already taken"
.
This is how you set a message error ONLY for username:
$this->form_validation->set_rules('username','Username','is_unique',array('is_unique' => 'The %s is already taken'));
This worked for me
$this->form_validation->set_message('is_unique', 'The username is already taken');