bootstrap正则表达式验证手机 座机 邮箱
$('#CusForm').bootstrapValidator({
fields : {
//验证手机
'customer.mobile' : { //input中的name 值
validators:{
regexp: {
regexp: /^1\d{10}$/ ,
message: '请输入正确的11位手机号'
}
}
},
//验证座机
'customer.phone' : {
validators:{
regexp: {
regexp: /^$|(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/ ,
message: '请输入正确座机电话'
}
}
},
//验证邮箱
'customer.email' : {
validators:{
regexp: {
regexp: /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/ ,
message: '请输入正确的邮箱地址'
}
}
},
}
});

浙公网安备 33010602011771号