Welcome Guest, Not a member yet? Register   Sign In
Displaying multiple validation errors from a single field simultaneously
#1

[eluser]Hibiscus[/eluser]
This is probably a simple question, but I haven't found the answer.

I'm using the form validation class with multiple rules on a single password field:

Code:
$this->form_validation->set_rules('password1', 'Password', 'required|min_length[6]|matches[password2]');

If I don't put anything in the field I want to see all the errors related to validation: field is required, field must have minimum 6 chars, field must match password confirmation field. Instead I only get the message that the field is required.

How do I get the validation to display all the errors related to the field at the same time?
#2

[eluser]mantis[/eluser]
Just call this function in your view:
&lt;?php echo form_error('passowrd1', '<div class="error">', '</div>'); ?&gt;




Theme © iAndrew 2016 - Forum software by © MyBB