![]() |
Issue with form validation and page content restarting - 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: Issue with form validation and page content restarting (/showthread.php?tid=61066) |
Issue with form validation and page content restarting - El Forum - 09-10-2014 [eluser]Unknown[/eluser] Basically, I have my controller function for adding in my case a page but let's focus on the function: Code: public function add() { Basically when the form is submitted it will still unset the postID in this case, however i want to ensure that if the form is submitted and there are errors that this is missed and it doesn't redo some of my functions and variables. This is happening for a lot of my content when the form is submitted it re-initiates variables that i want to be ignored. I also tried the following but it didn't work either: Code: if (!$this->form_validation->run() { How do i avoid the entire page being redone with form validation? Thanks Issue with form validation and page content restarting - El Forum - 09-11-2014 [eluser]InsiteFX[/eluser] Check for the submit button then you can change the form values that you want see the form_helper etc; Use the set_value |