Welcome Guest, Not a member yet? Register   Sign In
javascript validation vs. server side validation using ajax
#1

[eluser]megabyte[/eluser]
So here's my question.

I recently built an enormous form with the jquery form plugin, and jquery validation plugin.

It was probably one of the most painful experiences I've ever had, as I had to learn new stuff, and as always it seems there are always limitations when it comes to using a plugin.

Anyway weeks have passed and I have recently just completed another project that used a ton of Ajax.

So I thought to myself, why did I not just build the previous form, use CodeIgniter validation but submit it with Ajax.

To me this would make more sense because I get to use more PHP and less javascript. And if for some reason Javascript was not enabled, I don't have to have 2 forms of validation.

Any thoughts or views?
#2

[eluser]Buso[/eluser]
Javascript validation is faster and doesn't make unnecessary requests to your server, it's good to make the interface more user-friendly.
The server-side validation is still needed for security reasons though.
You only need ajax for things like checking if the user exists or not. Never for checking if the input matches the required regex (I don't like javascript either, but what can we do)




Theme © iAndrew 2016 - Forum software by © MyBB