KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am getting an error when trying to set custom validation messages in CodeIgniter for the min_length and max_length validation constraints. These are my validation rules: $this->form_validation->set_rules('username', 'Username', 'required|xss_clean|min_length[6]|max_length[10]'); $this->form_validation->set_rules('password', 'Password', 'required|min_length[8]|max_length[20]'; These are my custom validation message: $this->form_validation->set_message('min_length[3]', '%s: the minimum of characters is three'); $this->form_validation->set_message('max_length[20]', '%s:the maximum of characters is 20'); In my example we have two fields, but I have many fields with different minimum and maximum length values. They all have a specific constraint validations. This messages doesn't work. The message appears by default. Thanks for your help.
Tags (comma-separated)
Save Edits
Cancel