Form_validation doesn't work ... |
Hi!
I have controller with method: PHP Code: public function AddPost() { but form_validation not working. In autoload I have: PHP Code: $autoload['libraries'] = array( 'database', 'email', 'form_validation', 'ion_auth' ); PHP Code: $autoload['helper'] = array( 'url', 'form' );
I think their is a small issue with the logic in your controller. Try:
Code: $this->form_validation->run() !== FALSE One other thing I noticed is that your should not use xss_clean this way. From the documentation: XSS escaping should be performed on output, not input! (08-16-2015, 01:00 PM)Diederik Wrote: I think their is a small issue with the logic in your controller. Try: Ok, now it's ok, but is another problem ... I don't have messages with errors. I write in my controller: PHP Code: $this->form_validation->set_message('required', 'Error Message'); and in view: PHP Code: echo validation_errors() But I don't getting errors
Perhaps you should read the documentation. It has got tons of examples which should get you up on your feet.
http://www.codeigniter.com/userguide3/li...ation.html |
Welcome Guest, Not a member yet? Register Sign In |