I need your way of doing form validation - 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: I need your way of doing form validation (/showthread.php?tid=52903) |
I need your way of doing form validation - El Forum - 07-01-2012 [eluser]djuric[/eluser] I need to do form validation, I even did something like this on one of the validation cases: Code: if($this->input->post('submitted') =='yes') { // this is hidden field in the form and in view like: Code: if($success) { Validation errors is great, I use it when validation fails. But when validation passes and form is submitted successfully, I usually do something like above. Also, I could do something like this directly in view: Code: if($this->form_validation->run() === TRUE) { but it's not nice to do it in view. Is it? Thanks for any suggestions I need your way of doing form validation - El Forum - 07-01-2012 [eluser]psychoder[/eluser] you can pass your result to view and do the actions... Code: if($this->input->post('submitted') =='yes') { // this is hidden field in the form then in your view... do it like this... Code: echo $message; |