The name can’t be empty and password can’t be less than 6 characters long. The user will not be forwarded to the next page until given values are correct.
These methods are very convenient to use, but they do not provide the functionality of clearing all the fields, including their default values.
It can prevent people from leaving fields blank, from entering too little or too much or from using invalid characters.
For an alternative approach to client-side form validation, without Java Script, check out our new article on HTML5 Form Validation which is available now in most modern browsers.
It is important to validate the form submitted by the user because it can have inappropriate values. The Java Script provides you the facility the validate the form on the client side so processing will be fast than server-side validation.
So, most of the web developers prefer Java Script form validation.
View example » Parsley is shipped with more than a dozen useful validators.Now add the condition to ensure that all controls have a value, if the values are not entered in the form control then it will show a message.