jqBootstrapValidation

宋翔
2023-12-01

 

<input type="email" id="email" required>
<input 
  name="emailAgain"
  data-validation-matches-match="email" 
  data-validation-matches-message=
    "Must match email address entered above" 
>
<input 
  type="checkbox" 
  name="terms-and-conditions" 
  required 
  data-validation-required-message=
    "You must agree to the terms and conditions"
>
<input type="checkbox"
  name="qualityControl[]"
  value="fast"
  minchecked="2"
  data-validation-minchecked-message="Choose two"
  maxchecked="2"
  data-validation-maxchecked-message=
    "You can't have it all ways"
>

 Download jqBootstrapValidation and include the script tags on your page:

Apply the jqBootstrapValidation plugin to the elements you want validation applied to

 

<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><!-- or use local jquery --><scriptsrc="/js/jqBootstrapValidation.js"></script>

<script>
  $(function(){ $("input,select,textarea").not("[type=submit]").jqBootstrapValidation();});</script>
 类似资料:

相关阅读

相关文章

相关问答