CodeIgniter Forums

Full Version: Form validation - CI vs jQuery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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.

El Forum

[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.

El Forum

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

El Forum

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

El Forum

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

El Forum

[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.

El Forum

[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.