CodeIgniter Forums
Form validation - CI vs jQuery - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Form validation - CI vs jQuery (/thread-33547.html)



Form validation - CI vs jQuery - El Forum - 08-30-2010

[eluser]ToddyBoy[/eluser]
Which method of form validation do you use and why?

I can see the pros and cons of both methods. I was wondering which is the more popular method.


Form validation - CI vs jQuery - El Forum - 08-30-2010

[eluser]WanWizard[/eluser]
I guess a mixture is my best guess, altough jquery isn't always involved. Client-side vs Server-side would have been a better choice.

I always validate server-side, no matter what fancy features are build into the form. Client-side validation can sometimes be functional, but I only do it if I can stay client-side. I don't do ajax calls for validation.


Form validation - CI vs jQuery - El Forum - 08-30-2010

[eluser]tomcode[/eluser]
I always validate on server side, client side is convenience, but not trustworthy.


Form validation - CI vs jQuery - El Forum - 08-30-2010

[eluser]dreamer111[/eluser]
ONLY!!! server side. anything client-side can be easily faked.


Form validation - CI vs jQuery - El Forum - 08-31-2010

[eluser]victorche[/eluser]
Of course server side! jQuery fancy stuff can be eye candy, but this is not a real validation...


Form validation - CI vs jQuery - El Forum - 08-31-2010

[eluser]leonardteo[/eluser]
I'd say server side as a baseline, and use JQuery if you want to do some special user experience where it validates on the fly or something.


Form validation - CI vs jQuery - El Forum - 09-01-2010

[eluser]misplacedme[/eluser]
Both.
Validate on the users side so they user is quickly informed if they have wrong/missing information.
Validate on the server side because you can't trust the user not to send you invalid data.