<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. 解决问题E: 无法获得锁 /var/lib/dpkg/lock - open (11: 资源暂时不可用)

    在用sudo apt-get install 安装软件时,结果终端提示: “E: 无法获得锁 /var/lib/dpkg/lock - open (11: 资源暂时不可用) E: 无法锁定管理目录(/ ...

  2. canvas学习笔记、小函数整理

    http://bbs.csdn.net/topics/391493648 canvas实例分享 2016-3-16 http://bbs.csdn.net/topics/390582151 html5 ...

  3. Delphi 解析HTML

    uses mshtml; IHTMLEleMent.ID; IHTMLEleMent.tagName; IHTMLEleMent.title;elmt._className;elmt.getAttri ...

  4. UI5-文档-4.27-Mock Server Configuration

    我们只是在一个真实的服务上运行我们的应用程序,但是对于开发和测试我们的应用程序,我们不希望依赖于“真实”服务的可用性,或者在数据服务所在的系统上增加额外的负载. 这个系统就是所谓的后端系统,我们现在将 ...

  5. fiddler 修改request请求

    例:在request url后追加&test=1参数 在OnBeforeRequest函数中添加以下代码 if(oSession.uriContains("www.bing.com/ ...

  6. NTP时间服务器搭建

    系统时区设置::: 查看当前时区# date -R修改系统时区# timeconfig  或# cp  /usr/share/zoneinfo/Asia/Shanghai  /etc/localtim ...

  7. DELPHI WM_CopyData 用法

    unit Unit1; interface usesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, ...

  8. 发布MVC项目到服务器上时候遇到的 模块 DirectoryListingModule 通知 ExecuteRequestHandler 处理程序 StaticFile 错误代码 0x00000000

    应用程序“HMW121197”中的服务器错误错误摘要HTTP 错误 403.14 - ForbiddenWeb 服务器被配置为不列出此目录的内容. 详细错误信息模块 DirectoryListingM ...

  9. 进化的Spark, 从DataFrame说起

    进化的Spark, 从DataFrame说起:http://www.tuicool.com/articles/IzeY7zM

  10. cmd 获取 拖拽文件名

    1. @echo off & setlocal enableDelayedExpansion set a= set /p a=Please drag your txt file for spl ...