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代码等效于以下用法:

  • 相关阅读:
    poj1019——log10求位数
    poj2084——卡特兰数
    hdoj1023——卡特兰数
    poj1496——组合数学
    poj1850——组合数学
    bestcoder#29 1002 矩阵连乘快速幂解fib数列
    bestcoder#28 1002 dfs
    poj1458——dp,lcs
    hduoj1106
    codeforces#296div2_b 字符串,图
  • 原文地址:https://www.cnblogs.com/ishuanghe/p/5113501.html
Copyright © 2011-2022 走看看