Bug. Form validation fails if form array element is empty |
[eluser]Mikhail Menshinskiy[/eluser]
See: Codeigniter User Guide: Form validation Quote:If you do use an array as a field name, you must use the EXACT array name in the Helper Functions that require the field name, and as your Validation Rule field name. In this topic discussed another question. And your problem is an uncorrect working with CI library. And you have no a problem described above. You should: 1. In controller: load "form_validation" library 2. set up of validation rules. For your example Code: $this->form_validation->set_rules('selec[]', 'Seleccion', 'required'); 3. If validation is failed then load a view: Code: if ($this->form_validation->run() === FALSE) 4. In view: Code: <?php for ($i=0; $i<=3; $i++): ?> And please read a Codeigniter Guide for more information. Good luck =) |
Welcome Guest, Not a member yet? Register Sign In |