Possible Duplicate:
JavaScript: client-side vs. server-side validation
Hi I am beginner in jsp and servlet. I like to know if its better to use servlet or javascript to do form validation. what are the pros and cons for both methods? Thank you!
Possible Duplicate:
JavaScript: client-side vs. server-side validation
Hi I am beginner in jsp and servlet. I like to know if its better to use servlet or javascript to do form validation. what are the pros and cons for both methods? Thank you!
You always have to do a validation on the server side, because:
And for more fluidity of your application, you can also do a validation on the client side. For the client side, you can use this excellent plugin
For validation such as to check whether the email address entered is in correct format, or whether the first name field is all characters, or whether the phone number entered is number and not characters, you can use client side validation.
But for user credentials validations and other similar validations(security and data integrity) you should use server side validation.