Welcome Guest, Not a member yet? Register   Sign In
Custom error messages in Form Validation
#1

[eluser]Freeze Dried Pop[/eluser]
Hi there, i'm a little confused as to how to set custom error messages using the form validation library.

If I have a checkbox and I have set the rule to "required", the error message is something like "The Terms and Conditions field is required". I would prefer it to say "You must accept our terms and conditions". The user guide makes this look simple:

Code:
$this->form_validation->set_rules('terms_check', 'Terms and Conditions', 'required');
$this->form_validation->set_message('terms_check', 'You must accept our terms and conditions');

But this doesn't work, but I can't change the error message for "required" since it will give the same message for all required fields.

Is setting custom error messages in the way that I need possible?




Theme © iAndrew 2016 - Forum software by © MyBB