CodeIgniter Forums
not the typical validation question. - 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: not the typical validation question. (/showthread.php?tid=16195)



not the typical validation question. - El Forum - 02-27-2009

[eluser]jdfwarrior[/eluser]
This will sound odd, but is an actual html form required to use the form validation? I do a lot of my data submission via ajax via jquery, which only requires me to know the field id. Therefore I don't always use an actual form, I just throw an input field in where I need it and go. Info would be submitted to a CI controller as normal. I could easily make my own validation function if I needed to, but was just wondering if this would still work.

Any ideas?


not the typical validation question. - El Forum - 02-27-2009

[eluser]TheFuzzy0ne[/eluser]
The validation library has been designed to work directly on the $_POST array. No form, no $_POST array. That is, of course, unless you post using Ajax.

EDIT: I meant to say, "Yes, you can validate your Ajax requests using the form validation library, just as long as you submit the data using the POST method".


not the typical validation question. - El Forum - 02-27-2009

[eluser]jdfwarrior[/eluser]
Nice, this what I'm doing. Posting to the controller via ajax.