how to make form validation work here ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: how to make form validation work here ? (/showthread.php?tid=24592) |
how to make form validation work here ? - El Forum - 11-13-2009 [eluser]amira_fcis[/eluser] i tried to make update user information,in case of user didn't fill the required fields the form_avalidation will report an error.here is the problem when the user didn't fill the required fields nothing happened i donot know why ?!!!! here is the function Code: function updateUser() note--> the bold code i guess it causes the problem because i tried before without this 2 lines and it worked probably but here i need to retrieve user information again with any errors that user made. here is the form Code: <html> i'll be soooooooooo greatfull for any help how to make form validation work here ? - El Forum - 11-13-2009 [eluser]Vikeoar[/eluser] Shouldn't your validation run look something like: Code: if($this->form_validation->run() == FALSE) When I'm updating data from a db I have two methods in my controller "edit": this pulls the data into my initial edit view. Then "update" in my controller does the work on updating the database. "update" contains my validation code. I also use the set_value() function to re-set the edit page if there is a validation error. Check here: repopulating forms I don't see that you're using that anywhere in your form. how to make form validation work here ? - El Forum - 11-13-2009 [eluser]amira_fcis[/eluser] thanks Vikeoar for ur concern, i think Code: if (!$this->form_validation->run()) Code: if ($this->form_validation->run()==FALSE) |