> I am wondering what the relative advantages / disadvantages are of
> validating purely in php vs. in jQuery.

Neither is a replacement for the other, so using both is the best
solution.

Client-side validation with jQuery lets you give the user feedback
without requiring a page reload. That tends to be less jarring for the
user. You can also often autofill or autocomplete some fields using
ajax based on information the user gives in real time.

Server-side validation is the only way to guard against attacks like
SQL injection and cross-site scripting, and it is also the last-ditch
check in case the user had Javascript enabled.

Reply via email to