图1 为手机输入错误后的提示信息
图2 为点击提交后 弹出的提示信息
图2 的提示信息比图1的提示信息多了个文本框标题头一直查询代码 查不出原因
跟其他页面正常的validator验证规则对比了, 也查不出问题所在
下面贴出代码,望朋友们帮助分析分析
$.formValidator.initConfig({
formid: "change-form",
autotip: true,
onerror: function(msg, obj) {
window.top.art.dialog({
title: "系统提示", content: msg, icon: 'error', lock: true, width: '200', height: '50'
},
function() {
this.close();
$(obj).focus();
})
}});
$("#mobile").formValidator({
onshow: "请输入手机",
onfocus: "请输入手机",
oncorrect: "正确"
}).inputValidator({
min: 1,
onerror: "请输入手机"
}).regexValidator({
regexp: regexEnum.mobile,
onerror: "手机号码格式不正确,请检查"
});
$("#tel").formValidator({
onshow: "请输入电话,例如:0592-58686868",
onfocus: "请输入电话,例如:0592-58686868",
oncorrect: "正确"
}).functionValidator({
fun: function(val, elem) {
if (val.length < 1) {
return '请输入电话';
return false;
}
if (checkTelOrFax(val)) {
return true;
} else {
return '电话格式不正确';
return false;
}
}
});