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: Form Validation (/showthread.php?tid=55358) |
Form Validation - El Forum - 10-23-2012 [eluser]hkboateng[/eluser] Hello everyone, I am writing validation for my form and it seems not for work. I have done it before but I not know why is not working with these form. Code: public function signup_validation() Can someone let me know what am doing wrong. Thanks Form Validation - El Forum - 10-23-2012 [eluser]noslen1[/eluser] In your validation rules, you have "trm" instead of "trim" for your email, city, and state rules, you also have "xssclean" instead of "xss_clean" in your username rule. Don't know if that's what's blocking your app. Form Validation - El Forum - 10-23-2012 [eluser]hkboateng[/eluser] Thanks.. but I changed all the errors but is still not working. Is bypassing the validation rules to the if/else statements. Form Validation - El Forum - 10-23-2012 [eluser]noslen1[/eluser] What do you mean by "not working" ? Do you get the echo when not validated, or get redirected when validated ? What data did you try to insert ? Be more explicit please. Form Validation - El Forum - 10-23-2012 [eluser]hkboateng[/eluser] What I mean not working is, when the form in empty or if I type if a text to test the validation, it redirect to another page (as if false) but I wanted the validation to be printed on the form and not redirect to the failure page. Form Validation - El Forum - 10-23-2012 [eluser]noslen1[/eluser] Ohh, then just load your form view, without redirection, and display your errors in your form, for each field with something like that : Code: if (form_error('username')) : Form Validation - El Forum - 10-23-2012 [eluser]jojo777[/eluser] Have you checked if the callback 'callback_validate_credentials' is working properly. In adition if the $this->form_validation->run() check returns false... Code: if ($this->form_validation->run()) { Remember set in the view echo form_error for every field in the form. Say if it works. Form Validation - El Forum - 10-23-2012 [eluser]hkboateng[/eluser] Thank guys.. I have been able to fix it. Form Validation - El Forum - 10-23-2012 [eluser]jojo777[/eluser] [quote author="hkboateng" date="1350982814"]Thank guys.. I have been able to fix it.[/quote] Cool dude! Anyway, what was the problem?? |