1. The form must be checked to make sure all the mandatory fields are filled in.
2. The data that is entered must be checked for correct form and value. E.g. valid email or valid Phone numbers.
Now, to do the validation, we need to right down the same validation code again and again and also do testing. Too much time consuming stuff but still needs to be done on each form.
That's why Parsley is here: to let you define your general form validation, implement it on the backend side, and simply port it frontend-side, with maximum respect to user experience best practices.
Please download the parsley.min.js from http://parsleyjs.org/dist/parsley.min.js
and include it in header with any jquery.js.
and copy css from http://parsleyjs.org/src/parsley.css to your style.css
Thats it !
Read documentation here and make form validation in few minutes and that too using industry standard and very well tested code.
Happy validation !