var_dum ($ _ POST) gives the following result:

["name[]"]=> array(1) { [0]=> string(4) "Vasile" } ["lastname[]"]=> array(1) { [0]=> string(11) "Popov" } ["status[]"]=> array(1) { [0]=> string(1) "3" } ["area[]"]=> array(1) { [0]=> string(1) "3" } 

Further validation of CI:

 $this->form_validation->set_rules('name[]', 'Nume de părinte', 'required|xss_clean|htmlspecialchars|min_length[2]|max_length[10]'); $this->form_validation->set_rules('lastname[]', 'Prenume de părinte', 'required|xss_clean|htmlspecialchars|min_length[2]|max_length[14]'); 

As a result, during validation, despite the fact that name [] and lastname [] have data, it writes about the need to fill in these fields. What could be the reason for this?

  • one
    Show how you in the form derived these arrays - Opalosolo
  • If you are talking about this: <input type = "text" name = "name []" maxlength = "10" value = "" placeholder = "Nume"> <input type = "text" name = "lastname []" maxlength = "15" value = "" placeholder = "Prenume"> - Jony
  • Then the data is redefined - this is before validation. (On the client, the serialization of the form). parse_str ($ _ POST ['data'], $ params); // POST PARENT $ _POST ['name []'] = $ params ['name']; $ _POST ['lastname []'] = $ params ['lastname']; - Jony

0