![]() |
form validation class help - 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: form validation class help (/showthread.php?tid=25752) |
form validation class help - El Forum - 12-23-2009 [eluser]manitoon[/eluser] I was running the example given in the form validation tutorial and I am getting this problem that <?php echo validation_errors(); ?> shows errors even if the form is opened first time. It always shows errors how can i fix this issue ? form validation class help - El Forum - 12-23-2009 [eluser]flaky[/eluser] check if you have Code: $this->form_validation->run() form validation class help - El Forum - 12-23-2009 [eluser]manitoon[/eluser] nope there is no $this->form_validation->run() in the constructor. I guess i have to send a variable like "$form_submited" and then check it to whether show errors or not. form validation class help - El Forum - 12-23-2009 [eluser]flaky[/eluser] put the code here form validation class help - El Forum - 12-23-2009 [eluser]manitoon[/eluser] Code: <?php form validation class help - El Forum - 12-23-2009 [eluser]flaky[/eluser] well your code is in the index, so anytime the controller is called the validation is run form validation class help - El Forum - 12-23-2009 [eluser]manitoon[/eluser] oooh ok, now i understand. Thanks mate :-) form validation class help - El Forum - 12-23-2009 [eluser]flaky[/eluser] You should check if the submit button has been clicked. That way you can prevent the errors from appearing |