zoukankan      html  css  js  c++  java
  • BootstrapValidator(2)

    一、使用BootstrapValidator,需调用的CSS文件和JS库如下:

    <link rel="stylesheet" href="/path/to/bootstrap/css/bootstrap.css"/>

    <link rel="stylesheet" href="/path/to/dist/css/bootstrapValidator.min.css"/>

    <script type="text/javascript" src="/path/to/jquery/jquery-1.10.2.min.js"></script>

    <script type="text/javascript" src="/path/to/bootstrap/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="/path/to/dist/js/bootstrapValidator.min.js"></script>

    二、BootstrapValidator插件可以调用所有的选项,如下示例代码:

    即:

    $(formSelector).bootstrapValidator({

    excluded: [':disabled', ':hidden', ':not(:visible)'],

    feedbackIcons: {

    valid: 'glyphicon glyphicon-ok',

    invalid: 'glyphicon glyphicon-remove',

    validating: 'glyphicon glyphicon-refresh'

    },

    live: 'enabled',

    message: 'This value is not valid',

    submitButtons: 'button[type="submit"]',

    submitHandler: null,

    trigger: null,

    fields: ...

    });

    您可以使用HTML属性设置选项:

    所以上面的JS代码等效于以下用法:

  • 相关阅读:
    测试方法与步骤
    团队项目需求分析
    第一次个人作业
    3种shell自动交互的方法
    mysql用户管理
    build web application with golang
    安卓中的LINUX内核
    结对项目小结
    关于aria2-yaaw下载软件
    软工结对项目预览
  • 原文地址:https://www.cnblogs.com/ishuanghe/p/5113501.html
Copyright © 2011-2022 走看看