I do this:

var formSubmit = $(element).closest('form').serialize(); $.ajax({ type: "POST", dataType: "json", data: {formData : formSubmit, data : data },.... 

How to take server side? so that you can check the codeigniter validation rules?

  • why even serialize something? > so that you can check Codeigniter validation rules? I doubt that the validator cares about the source of the data - etki
  • Serialization is not for validation, if you so strictly and incorrectly understood this connection ... below in the answer - described the problem more clearly - Jony
  • @Oleg Ponomarchuk, I did not understand why it was originally needed. - etki
  • That in Jquery not to enumerate all fields of the form - there are about 10. The point is no longer in this. When I transfer the English text and output it to var_dump, I get: string (42) "subject = ffff & message = gjigiun" - in the array there is no value message - Jony
  • Array output from parse_str: Array ([subject] => lllllll [message;] => oiiili) - Jony

1 answer 1

It turns out that way:

 parse_str($this->input->post('formData'),$array); $_POST['message'] = $array['message']; 
  • But with this option - parse_str () does not miss the Russian text - Jony
  • var_dump $ _POST shows: & message; = message "For some reason it is inserted; after message - Jony