A quick one guys, I have the same (ish) form validation rule for the username and email input fields respectively, and i need to set the message of the rules individually. How do i do that?
**CODE**
$this->form_validation->set_rules('username','Username', 'trim|required|xss_clean|min_length[2]|is_unique[users.username]');
$this->form_validation->set_rules('email','Email', 'trim|required|valid_email|xss_clean|is_unique[users.email]');
I'm trying to override the message for "is_unique" here,
$this->form_validation->set_message('is_unique','Username taken');
how do i set the message for email as well?
$this->form_validation->set_message('is_unique', '%s is taken.');
%s is replaced with the "human name" you applied when setting the rule.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With