国内固定电话正则验证:'tel': [/0\d{2,3}-\d{7,8}(|([-\u8f6c]{1}\d{1,5}))$/, "请填写有效的电话号码"],

// 验证字段
$('#info_form').validator({
rules : {
checkMobile : function(ele) {
return checkMobile(ele);
},
'tel': [/0\d{2,3}-\d{7,8}(|([-\u8f6c]{1}\d{1,5}))$/, "请填写有效的电话号码"],
},
fields : {
'#agentName' : {
rule : 'required;',
msg : {required : '请输入姓名'}
},
'#email' : {
rule : 'email',
msg : {required : '请输入电子邮箱'}
},
'#qq' : {
rule : 'length[5~11]',
msg : {required : '请输入QQ', length : '请输入有效的QQ'}
},
'#tel':{
rule : 'tel',
}
},
valid : function(form) {
// 事件 - 提交
g_http.ajaxByPostSyncWithLogin('/webAgent/update', $('#info_form').serialize(), "json", function(data) {
if (data.status == 0) {
// 保存提示
layerUtil.success("修改成功!");
}
});
}
});

上一篇:jsp:useBean的使用


下一篇:在线学习和在线凸优化(online learning and online convex optimization)—在线分类问题2