Issues with Ajax Form, Validation, and yes CSRF - 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: Issues with Ajax Form, Validation, and yes CSRF (/showthread.php?tid=39928) |
Issues with Ajax Form, Validation, and yes CSRF - El Forum - 03-24-2011 [eluser]otherjohn[/eluser] Hi all, I have a form loaded via Ajax and submitted via ajax. when the ajax form is loaded, a user can click the save button which using jQuery, submits the form using ajax. I am getting 2 issues. 1. When I submit the form, I always get $this->form_validation->run() == FALSE and it never runs to true. But there is no validation rules setup. 2. if I hit submit again, i get a CSRF error because the token is different but the cookie hasn't changed. I can't seem to get this simple form to work. There is no validation rules to trip it up! And CSRF token is being sent via ajax Below is my code: Code: My controller Code Code: my ajax code Issues with Ajax Form, Validation, and yes CSRF - El Forum - 03-24-2011 [eluser]otherjohn[/eluser] I should mention that I have HMVC installed and just added $this->load->library('form_validation', array('CI' => $this)); but I am getting a new error ErrorException [ Fatal Error ]: Cannot use object of type Admin as array SYSDIR/var/www/vhosts/churchbackend.com/_sys/libraries/Form_validation.php [ 90 ] Admin is the controller's name |