JavaScript form Validation-parsley.js use and configuration _javascript tips

Source: Internet
Author: User
Online Demo
We also remember that we have introduced the form to verify the jquery plug-in Jquery.validationengine bar, use this plug-in you do not need to write any one line of JS code can generate a powerful form verification function. Isn't it awesome? The parsley introduced today can also help you implement form validation with a simple configuration, based on its powerful dom-api.

Main Features
• Based on the excellent user experience
• Super Convenient configuration
• Ultra Lightweight (12K compressed) support for jquery and Zepto
• Super simple, simply configure DOM-API, a data API similar to jquery
• Absolutely FREE
• Very good reliability

built-in validation
Required: Require input
not blank: cannot be empty
min Length: Min.
max length: maximum lengths
Range Length: range of Lengths
min: Minimum value
Max: Max value
Range: Zone value
regexp: Regular Expressions
equal to: Equals
min Check: Check the minimum number of selected checkbox
max check: Check the maximum number of selected checkbox
Range Check: Check the interval number of selected checkbox
Remote:ajax Verification
Using and configuring Parsley.js is very simple, you only need to use the HTML Data property to configure HTML, as follows:
Copy Code code as follows:

<form id= "demo-form" data-validate= "parsley" >
<label for= "FullName" >full Name *:</label>
<input type= "text" id= "FullName" Name= "FullName" data-required= "true"/>
<label for= "Email" >email *:</label>
<input type= "text" id= "email" name= "email" data-trigger= "Change" data-required= "true" data-type= "email"/>
<label for= "website" >website:</label>
<input type= "text" id= "website" name= "website" data-trigger= "change" data-type= "url"/>
<label for= "message" >message (chars min, max):</label>
<textarea id= "message" name= "message" data-trigger= "KeyUp" data-rangelength= "[20,200]" ></textarea>
</form>

is not very convenient, and the document is very complete, but if you need to use Chinese, you need to localize yourself, I believe that if the use of friends will love!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.