1 如何使用

引入

<link href="bootstrapValidator.min.css" rel="stylesheet"> css文件
<script src="bootstrapValidator.min.js"></script> js文件
2 在文档加载完成初始化
<script type="text/javascript">
$(document).ready(function () {
  

 $("#divDataArea").bootstrapValidator({
message: 'This value is not valid',
live: 'enabled',
excluded: ':disabled',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
// WarrantIssued
TotalAssetsBid: {
message: 'TotalAssetsBid should be number',
validators: {
stringLength: {
min: ,
max: ,
message: 'lenght should be between 2 and 10.'
}
}
},
WarrantIssued: {
message: 'WarrantIssued should be number',
trigger:'change',
validators: {
stringLength: {
min: ,
max: ,
message: 'lenght should be between 2 and 10.'
}
}
}
}
});
</script>
3 如果使用的动态添加元素
可使用

$("#divDataArea").bootstrapValidator('addField',"WarrantIssued")方法添加验证字段,第二个参数为验证的字段的name属性值
4 点击自定义按钮开始验证的方式:
 var bootstrapValidator = $("#divDataArea").data("bootstrapValidator");
bootstrapValidator.validate();
var valid = bootstrapValidator.isValid();
if (valid == false) {
return;
}

1 bootstrapValidator使用的更多相关文章

  1. bootstrapvalidator+bootstrap-select select无法校验问题解决方法

    $("#form_user_input") .bootstrapValidator( { message : 'This value is not valid', excluded ...

  2. Bootstrap表单验证插件bootstrapValidator使用方法整理

    插件介绍 先上一个图: 下载地址:https://github.com/nghuuphuoc/bootstrapvalidator 使用方法:http://www.cnblogs.com/huangc ...

  3. JS组件系列——Form表单验证神器: BootstrapValidator

    前言:做Web开发的我们,表单验证是再常见不过的需求了.友好的错误提示能增加用户体验.博主搜索bootstrap表单验证,搜到的结果大部分都是文中的主题:bootstrapvalidator.今天就来 ...

  4. bootstrapvalidator校验、校验清除重置

    //保存 function saveAdmin(){ //开启验证 $('#saveadmin_form').data('bootstrapValidator').validate(); if(!$( ...

  5. bootstrapValidator.js,最好用的bootstrap表单验证插件

    前言:做Web开发的我们,表单验证是再常见不过的需求了.友好的错误提示能增加用户体验.博主搜索bootstrap表单验证,搜到的结果大部分都是文中的主题:bootstrapvalidator.今天就来 ...

  6. jQuery 实现bootstrapValidator下的全局验证

    前置: 引入jQuery.bootstrap.bootstrapValidator 问题描述: 项目中要求所有的表单输入框中都不能输入&符号.没有在bootstrap中找到有方法可用,只能自己 ...

  7. bootstrapValidator.js 做表单验证

    有这样的一个场景,我们在提交form表单的时候 可能要做一些验证,比如判断是不是为空,电话的格式验证,邮箱的格式验证等等,手写起来也是可以得. 但是今天我介绍一个bootstrap插件简化开发.就是b ...

  8. 【bootstrapValidator 不验证】使用bootstrapValidator 验证效果不起作用

    虽然在页面ready的时候 就绑定了验证表单 ,但是在点击提交按钮之后 依旧没有验证的效果 . 那就在提交按钮的点击事件中 添加一句话: $(document).ready( function () ...

  9. bootstrap-validator验证问题总结

    bootstrap-validator是一个优秀的验证器,使用中遇到如下问题,总结如下: 1.<button type="submit" name="submit2 ...

  10. BootstrapValidator验证表单用法

    引入文件 <link rel="stylesheet" href="css/bootstrap.css"/> <link rel=" ...

随机推荐

  1. leetcode 96. Unique Binary Search Trees 、95. Unique Binary Search Trees II 、241. Different Ways to Add Parentheses

    96. Unique Binary Search Trees https://www.cnblogs.com/grandyang/p/4299608.html 3由dp[1]*dp[1].dp[0]* ...

  2. SQL-W3School-高级:SQL IN 操作符

    ylbtech-SQL-W3School-高级:SQL IN 操作符 1.返回顶部 1. IN 操作符 IN 操作符允许我们在 WHERE 子句中规定多个值. SQL IN 语法 SELECT col ...

  3. JAVA踩坑录

    以前踩了很多坑,大多忘了.现在踩了坑,想起了一定记下来. 1. 字符串分割,这种工具类,首次使用一定要先看一眼,不然跳坑 commons-lang StringUtils.split分割时会去掉空串: ...

  4. 在IIS7、IIS7.5中应用程序池最优配置方案

    先介绍几个简单的设置 应用程序池 > 高级设置 1.基本设置 队列长度: 65535 启动32位应用程序 否则安装一些32的组建或32位的php都会出错 托管管道模式 Classsic 2.高级 ...

  5. C++ STL 逆转旋转 reverse reverse_copy rotate

    #include <iostream>#include <algorithm>#include <vector>#include <iterator> ...

  6. 关于运维之故障复盘篇-Case Study

    关于故障的事后复盘,英文名 Case Study是非常有必要做的,当然是根据故障的级别,不可能做到每个故障都Case Study,除非人员和时间充足: 文档能力也是能力的一种,一般工程师的文档能力比较 ...

  7. Java使用Java OCR API进行验证码识别

    Maven坐标: <!-- https://mvnrepository.com/artifact/com.asprise.ocr/java-ocr-api --> <dependen ...

  8. webdriver(chrome无头浏览器)

    '''chrome无头浏览器''' from selenium.webdriver.chrome.options import Options # 导入相应的类 from selenium impor ...

  9. CentOS7.5安装GitLab及汉化

    一.GitLab英文版安装 1.下载gitlab安装包,然后安装 wget --content-disposition https://packages.gitlab.com/gitlab/gitla ...

  10. java中length和length()的区别?

    在java中String类可以定义字符串变量和字符串数组,length()用于求String字符串对象的长度,而length用  于求String字符串数组的长度.  length()是求String ...