Creating an Ajax Form
May 12, 2009 | Posted in Javascript, PHP
When creating forms that need to be validated against a user's input, you can either validate on the client-side (Javascript), or the server-side (PHP in this case).
But if you want to use Javascript, then someone with Javascript turned off could easily submit the form and bypass all validation.
That's where AJAX comes in. You do all the validation on the server-side, but return the results back to the user with Javascript and no page refreshes. It's really the best of both worlds. Plus it degrades good enough if someone has Javascript disabled.





