Bootstrapvalidator-based data validation

Source: Internet
Author: User

Do web development, often need to use to form verification, the author himself began to write a variety of verification, recently contacted Bootstrapvalidator, feel very useful, friendly interface, easy to use, and bootstrap perfect compatibility, called the front-end data validation artifact.
So, today, let's look at how to use Bootstrapvalidator to do form verification!
First, use Bootstrapvalidator to download the package from the GitHub bootstrapvalidator project page.

style sheet (CSS) files:
Bootstrap.min.css
BootstrapValidator.min.css
js script file:
Jquery-1.10.2.min.js
Bootstrap.min.js

The login interface is as follows:

The login interface code is as follows:

PS: The author uses the Botstrap framework to write the interface, if you are not familiar with the Bootstrap framework, then you can read the author's previous article "Web Front-end framework learning-bootstrap" to understand Bootstrap.

Import bootstrapvalidator CSS files, JS files, you need to write a jquery script for data validation. Here is a simple jquery data validation script written by the author, which can be read with reference to the documentation comments.

After adding the validation, let's look at:
Here the author of the user name is set to use email substitution, enter the wrong email address, data validation does not pass, CSS control input box is displayed in red, you can not click the login button.

Enter the correct email address, enter the wrong password, data validation does not pass, the CSS control input box is displayed in red, you can not click the login button.

When the user name, password all entered correctly, the data validation through, the CSS control input box is displayed as green, you can click the login button.

In the age of Internet, learning becomes more convenient and information is available at your fingertips.
1. Bootstrapvalidator on GitHub's homepage
2. Bootstrapvalidator tutorial based on jquery,bootstrap data validation plugin
3. JS Component series--form form verification artifact: Bootstrapvalidator

Bootstrapvalidator-based data validation

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.