Bootstrap Validator HTML attributes options

Source: Internet
Author: User

Common HTML attributes:
Data-fv-message="The username is not valid"
data-fv-notempty="true"
Data-fv-notempty-message="The username is required and cannot was empty"
data-fv-regexp="true"
data-fv-regexp-regexp="^[a-za-z0-9_\." +$ "data-fv-regexp-message=" The username can only consist of alphabetical, number, dot and underscore "
Data-fv-stringlength="true"
data-fv-stringlength-min="6"data-fv-stringlength-max= "30"
Data-fv-stringlength-message="The username must is more than 6 and less than-characters long"

How to use:
    • Page Add Reference

<link href= "Styles/bootstrap.css" rel= "stylesheet"/>
<link href= "Styles/bootstrapvalidator.css" rel= "stylesheet"/>
<script src= "Scripts/jquery-1.10.2.min.js" ></script>
<script src= "Scripts/bootstrap.min.js" ></script>
<script src= "Scripts/bootstrapvalidator.js" ></script>

    • Increase the corresponding validation attributes as required

Such as:<input type="text" class="form-control" name="firstName" placeholder="First name" data-fv-row=".col-xs-4" data-fv-notempty="true"< Span class= "s" > data-fv-notempty-message= " The first name is required and cannot are empty "/>
span>

    • After the page loads, execute: $ ("#Form"). Bootstrapvalidator (Options)
      For options instructions, please refer to: http://bv.doc.javake.cn/settings/

Bootstrap Validator HTML attributes options

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.