zoukankan      html  css  js  c++  java
  • bootstrap validator html attributes 选项

    常用的html属性:
    data-fv-message="The username is not valid"
    data-fv-notempty="true"
    data-fv-notempty-message="The username is required and cannot be 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 be more than 6 and less than 30 characters long"

    如何使用:
    • 页面增加引用

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

    • 按需求增加相应的验证属性

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

    • 页面加载后执行: $("#Form").bootstrapValidator(options)
      有关options 说明请参考:http://bv.doc.javake.cn/settings/
  • 相关阅读:
    基于HTTP和TFTP的PXE批量自动化安装Linux系统
    使用U盘进行Linux系统的安装
    CentOS 7单用户模式修改root密码
    LVS的调度算法分析
    linux LVS DR模式配置
    Nagios的客户端的安装
    Nagios监控系统的安装
    Linux内核升级
    redhat linux使用Centos yum源
    Juniper srx防火墙NAT配置
  • 原文地址:https://www.cnblogs.com/sgciviolence/p/5437882.html
Copyright © 2011-2022 走看看