<div class="modal fade" id="myModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<form id="addBookCode">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h1 class="modal-title" id="myModalLabel"><span>场景信息配置</span></h1>
</div>
<div class="modal-body">
<div class="form-group col-xs-12">
<div class="col-xs-4 text-right">
<label class="label_contorl text-right" for="txt_SenarioName_">情景名称:</label>
</div>
<div class="col-xs-7">
<input name="txt_SenarioName_" id="txt_SenarioName_" class="form-control" value="" />
</div>
<label class="label_contorl text-left message">*</label>
</div>
<div class="form-group col-xs-12">
<div class="col-xs-4 text-right">
<label class="label_contorl text-right" for="txt_YieldRateCurve_">收益率曲线:</label>
</div>
<div class="col-xs-7">
<asp:DropDownList ID="txt_YieldRateCurve_" name="txt_YieldRateCurve_" runat="server" CssClass="form-control datacontrol drop_combo"></asp:DropDownList>
</div>
<label class="label_contorl text-left message">*</label>
</div>
<div class="form-group col-xs-12">
<div class="col-xs-4 text-right">
<label class="label_contorl text-right" for="txt_SearchCloseDate_">曲线日期:</label>
</div>
<div class="col-xs-7">
<asp:DropDownList ID="txt_SearchCloseDate_" name="txt_SearchCloseDate_" onclick="WdatePicker()" Format="{0:yyyy-MM-dd}" runat="server" CssClass="form-control datacontrol drop_combo"></asp:DropDownList>
</div>
<label class="label_contorl text-left message">*</label>
</div>
<div class="form-group col-xs-12">
<div class="col-xs-4 text-right">
<label class="label_contorl text-right" for="txt_Currency_">货币:</label>
</div>
<div class="col-xs-7">
<asp:DropDownList ID="txt_Currency_" name="txt_Currency_" runat="server" CssClass=" datacontrol form-control"></asp:DropDownList>
</div>
<label class="label_contorl text-left message">*</label>
</div>
<div class="form-group col-xs-12">
<div class="col-xs-4 text-right">
<label class="label_contorl text-right" for="txt_EndUser_">使用单位:</label>
</div>
<div class="col-xs-7">
<asp:DropDownList ID="txt_EndUser_" name="txt_EndUser_" runat="server" CssClass=" datacontrol form-control"></asp:DropDownList>
</div>
<label class="label_contorl text-left message">*</label>
</div>
<div class="clearfix"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary btn-sm" id="btn_save1">确认</button>
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">关闭</button>
</div>
</div>
</form>
</div>
</div>
//添加新增验证规则
$('#myModal').bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
txt_SenarioName_: {
validators: {
notEmpty: {
message: '不能为空'
}
}
},
txt_YieldRateCurve_: {
validators: {
notEmpty: {
message: '不能为空'
}
}
},
txt_SearchCloseDate_: {
validators: {
notEmpty: {
message: '不能为空'
}
}
},
txt_Currency_: {
validators: {
notEmpty: {
message: '不能为空'
}
}
},
txt_EndUser_: {
validators: {
notEmpty: {
message: '不能为空'
}
}
}
}
}); $('#myModal').on('hide.bs.modal', function (e) {
$("#myModal").data('bootstrapValidator').resetForm()
}) function ModelValidate() { var bootstrapValidator = $("#myModal").data('bootstrapValidator');
//手动触发验证
$("#myModal").data('bootstrapValidator').validate()
if (bootstrapValidator.isValid()) {
console.log("tj")
//表单提交的方法、比如ajax提交
$('#myModal').modal('hide') }
else {
return false;
}
}

Bootstrap验证的更多相关文章

  1. Bootstrap验证控件的使用

    前端HTML代码 <form id="myForm" method="post" class="form-horizontal" ac ...

  2. bootstrap validate 验证插件

    1.需要引入bootstrapValidator.min.js 2.在需要验证的控件中添加 class="form-control" 3.js中写验证的方法 $('#psasave ...

  3. ASP.NET MVC使用Bootstrap系统(2)——使用Bootstrap CSS和HTML元素

    阅读目录 Bootstrap 栅格(Grid)系统 Bootstrap HTML元素 Bootstrap 验证样式 ASP.NET MVC创建包含Bootstrap样式编辑模板 小结 Bootstra ...

  4. BootStrap-validator 使用记录(JAVA SpringMVC实现)

    BootStrap 是一个强大的前面框架,它用优雅的方式解决了网页问题.最近正在使用其开发网站的表单验证,一点体会记录如下: 注:本文中借鉴了博客Franson 的文章<使用bootstrapv ...

  5. bootstrapvalidator API 文档地址: http://bootstrapvalidator.votintsev.ru/api/

    bootstrap验证插件 bootstrapvalidator 文档API 地址 (原始作者英文):http://bootstrapvalidator.votintsev.ru/api/ 具体使用( ...

  6. Docker多机网络

    前言 前面的文章主要聚焦于单机网络上,对于生产环境而言,单机环境不满足高可用的特点,所以是不具备上生产的条件,因此在开始Docker Swarm篇的时候我们先来聊聊多机网络之间Docker的通信如何做 ...

  7. bootstrap validate 实现页面动态验证(formvalidate)

    关于基本的bootstrap validate 验证方法外面有许多博客上都有讲解,我就不在过多叙述了.大家也可以去看官网api:http://bv.doc.javake.cn/api/ 今天要说的是动 ...

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

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

  9. MVC遇上bootstrap后的ajax表单模型验证

    MVC遇上bootstrap后的ajax表单验证 使用bootstrap后他由他自带的样式has-error,想要使用它就会比较麻烦,往常使用jqueyr.validate的话只有使用他自己的样式了, ...

随机推荐

  1. 字符串和JSON对象互转的方法

    采用Ajax的项目开发过程中,经常需要将JSON格式的字符串返回到前端,前端解析成JS对象(JSON ).字符串转JSON对象 1.eval方式解析.function strToJson(str){ ...

  2. 转。。原理同样支持 delphi

    我用C#导出excel 带图片,用office2003 正常,但换成office 2007 时,我指定多个单元格分别插入图片,这个图片不在此单元格内,这些图片全都集中在一起,在一个位置上.很奇怪,看起 ...

  3. Nginx_status显示结果详解

    打开:http://aabb.com/nginx_status会有如下显示Active   connections: 2872server   accepts  handled requests294 ...

  4. nginx-----惹不起的端口修改

    1,查看端口是否被占用 打开CMD,输入输入netstat -aon | findstr :80 出现: TCP    0.0.0.0:80             0.0.0.0:0        ...

  5. 将JDBC的resultSet映射到JavaBaen

    // 执行赋值后SQL,            rs=pstm.executeQuery();            //判断是否有返回结果,有下一行rs.next()方法为true          ...

  6. struts2的运行流程

    流程: 1:url 提交到tomcat http://localhost/s2/firstAction 2:tomcat 根据工程名 去 webapps 文件夹下找到对应工程 3:找web.xml S ...

  7. PEP8 Python 编码规范整理(转)

    决定开始Python之路了,利用业余时间,争取更深入学习Python.编程语言不是艺术,而是工作或者说是工具,所以整理并遵循一套编码规范是十分必要的.所以今天下午我根据PEP 8整理了一份,以后都照此 ...

  8. 基于JS的文本验证

    1,不能为空 <input type="text" onblur="if(this.value.replace(/^ +| +$/g,'')=='')alert(' ...

  9. Eclipse中Git插件使用技巧:还原文件

    如果修改了某个文件并未提交至本地库(add index),那么怎么还原呢?Git插件中并不像Svn插件直接提供有还原方式.其实无论是否提交至本地库或者远程库,还原操作的本质都是将文件的当前版本还原至之 ...

  10. padright padleft

    在 C# 中可以对字符串使用 PadLeft 和 PadRight 进行轻松地补位. PadLeft(int totalWidth, char paddingChar) //在字符串左边用 paddi ...