![]() |
Displaying multiple validation errors from a single field simultaneously - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Displaying multiple validation errors from a single field simultaneously (/showthread.php?tid=13364) |
Displaying multiple validation errors from a single field simultaneously - El Forum - 11-19-2008 [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? Displaying multiple validation errors from a single field simultaneously - El Forum - 11-19-2008 [eluser]mantis[/eluser] Just call this function in your view: <?php echo form_error('passowrd1', '<div class="error">', '</div>'); ?> |