//表单验证
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();
});
};
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有