![]() |
new form_validation array question - 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: new form_validation array question (/showthread.php?tid=31496) |
new form_validation array question - El Forum - 06-21-2010 [eluser]EugeneS[/eluser] Hello, according to the docs i'm using it this way: inside html form Code: <input type="text" name="Order[]" value="1"> controller: Code: $this->load->library('form_validation'); the questions are: 1) instead of lot of questions above how can i access to the different "Order" fields data separately or may be at once as to array through which i can loop later to access data separately 2) in case of not an array can i still use the way which was previously used (in the old version of the library) like Code: $this->validation->FIELD_NAME cant find these details in documentation new form_validation array question - El Forum - 06-29-2010 [eluser]EugeneS[/eluser] no one knows ? new form_validation array question - El Forum - 06-29-2010 [eluser]n0xie[/eluser] Code: var_dump($_POST); new form_validation array question - El Forum - 06-29-2010 [eluser]EugeneS[/eluser] [quote author="n0xie" date="1277836418"] Code: var_dump($_POST); i need access to already validated results but not to the initial data ... for example if in the rule was "trim" i need access to the trimmed data but not to the initial one. in old version i was alble to access it ... can i in new one ? new form_validation array question - El Forum - 06-29-2010 [eluser]danmontgomery[/eluser] Code: $this->input->post('field_name'); new form_validation array question - El Forum - 09-03-2010 [eluser]EugeneS[/eluser] still no answer to this ... how i can get access to the validated data ? in previous version of this library i was able to access to the validated data through Code: $this->validation->FIELD_NAME in new version of the library its impossible at least i cant find HOW ? so lets say in the form field was entered "HELLO WORLD " (pay attention to 4 spaces after the word WORLD) lets say this field was validated with the rule "required|trim" as a result spaces should be removed "HELLO WORLD" (spaces removed) so how can i get access to the validated result WITHOUT SPACES ? why this powerfull feature was removed ? ![]() new form_validation array question - El Forum - 09-03-2010 [eluser]danmontgomery[/eluser] This was answered in June. Even ignoring that post, you can pop open form_validation.php, look at the end of the run() method and see: Code: // Now we need to re-set the POST data with the new, processed data Hm... So, we look at _reset_post_array() and see in the comment just above it: Code: /** So, [quote author="noctrum" date="1277847564"] Code: $this->input->post('field_name'); new form_validation array question - El Forum - 09-03-2010 [eluser]EugeneS[/eluser] noctrum, have you tried it with the print_r ? try it ... inside Code: $this->input->post('field_name') |