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:
<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