您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 南平分类信息网,免费分类信息发布

bootstrapValidator自定验证方法写法

2024/3/21 7:07:34发布8次查看
本文实例为大家分享了bootstrapvalidator自定验证方法写法,供大家参考,具体内容如下
//表单验证 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(); }); };
南平分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录