bootstrapValidator 自定验证方法写法
来源:互联网 发布:python write 编辑:程序博客网 时间:2023/09/28 01:52
//表单验证
issueInvoiceForm.validation = function(){$('#issueInvoiceForm').on('init.field.bv', function(e, data) { var $icon = data.element.data('bv.icon'), options = data.bv.getOptions(), // Entire options validators = data.bv.getOptions(data.field).validators; // The field validators if (validators.notEmpty && options.feedbackIcons && options.feedbackIcons.required) { $icon.addClass(options.feedbackIcons.required).show(); } }).bootstrapValidator({ container:'popover',feedbackIcons: {required: 'glyphicon glyphicon-asterisk requiredStar', valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: { invoiceDate:{validators: {notEmpty: {message: '开票日期不能为空'}}},//开票日期 code:{validators: {notEmpty: {message: '发票编码不能为空'}}}, amount:{ validators:{ notEmpty: {message: '发票金额不能为空'}, numeric: {message: '发票金额只能输入数字'}, callback: { message: '开票金额小于选中金额', callback: function(value, validator) { return false; } } } }, taxRate:{ validators:{ notEmpty: {message: '税率不能为空'}, numeric: {message: '税率只能输入数字'} } }, taxAmount:{ validators:{ notEmpty: {message: '税额不能为空'}, numeric: {message: '税额只能输入数字'} } }, },group:'.validateDiv'}).on('success.form.bv', issueInvoiceForm.issueInvoiceFormBtn).on('error.form.bv',function(){ $("#issueInvoiceFormBtn").removeAttr("disabled");//将保存按钮去除disabled $(".has-error:visible:first").find(":input").focus(); });};
API:http://bv.doc.javake.cn/api/
1 0
- bootstrapValidator 自定验证方法写法
- bootstrapValidator验证
- bootstrapValidator 全局验证
- 表单验证 BootstrapValidator
- 表单验证之BootstrapValidator
- bootstrapValidator验证的问题
- bootstrapvalidator自定义验证
- BootstrapValidator验证表单注意事项!
- 表单验证之bootstrapvalidator
- bootstrapValidator + Ajax表单验证
- bootstrapValidator表单验证使用方法
- 表单验证-bootstrapValidator
- bootstrapvalidator 验证用户名存在
- 重置bootstrapValidator验证
- validform中自定验证提示位置
- 使用BootstrapValidator实现表单验证
- Form表单验证神器: BootstrapValidator
- boostrap表单验证插件-bootstrapValidator
- 堆与栈的区别
- IC卡NATIVE个人化操作的一个流程式cs源代码
- 项目添加native支持(Eclipse和AS)
- python dlib、opencv 配置
- string数据类型
- bootstrapValidator 自定验证方法写法
- 内存泄露
- 我在开发上传图片文件预览的时候IE无法正常显示,火狐可以正常显示
- Unity3D Shader官方教程翻译(四)
- Java中Double型数据的加,减,乘,除
- SonicUI在MFC中的使用
- Android Graphics(二):路径及文字
- 4.1 MySQL程序概述
- printStream类和PrintWriter类