//验证是否为车牌号
function isCarnum(carnb) {
var bValinum = RegExp(/^[a-zA-Z]{1}[a-zA-Z_0-9]{5}$/).test(carnb);
if (bValinum) {
return true
} else {
return false
}
}
//验证姓名
function isName(carname) {
var bValiName = RegExp(/^[\u4e00-\u9fa5]{2,15}$/).test(carname);
if (bValiName) {
return true
} else {
return false
}
}
//验证电话号码
function isPhone(cartel) {
var bValiPhone = RegExp(/^1[3|4|5|7|8][0-9]{9}$/).test(cartel);
if (bValiPhone) {
return true;
}
else{
return false;
}
}
//非负数
function isZnum(number) {
var bValiZnum = RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(number);
if (bValiZnum) {
return true;
}
else{
return false;
}
}
//正整数
function isZnumber(number) {
var bValiZnumber = RegExp(/^[0-9]*[1-9][0-9]*$/).test(number);
if (bValiZnumber) {
return true;
}
else{
return false;
}
}
var img1 = $("#preview").attr("src");
var img2 = $("#preview1").attr("src");
var img3 = $("#preview2").attr("src");
var img4 = $("#preview3").attr("src");
var img5 = $("#preview4").attr("src");
var img6 = $("#preview5").attr("src");
/* $("input[type=file]").mousedown(
function () {
img1=$("#preview").attr("src");
img2 = $("#preview1").attr("src");
img3 = $("#preview2").attr("src");
img4 = $("#preview3").attr("src");
img5 = $("#preview4").attr("src");
img6 = $("#preview5").attr("src");
})*/
$("#preview").load(function(){
img1=$("#preview").attr("src");
console.log(img1)
});
if (cartel == "" || cartel == null) {
$(".layerbigb .titlemsg").text("联系电话不能为空");
$(".layerbigb").css("display", "block");
return false
}
if (cartel !== "" || cartel !== null) {
if (!isPhone(cartel)) {
$(".layerbigb .titlemsg").text("请输入正确的电话号码");
$(".layerbigb").css("display", "block");
return false
}
}
//正则匹配中文名
var pattern_name = /^[\u4E00-\u9FA5]{1,5}$/;
if(!pattern_name.test(driver_user_name)){
$(".layerbigb .titlemsg").text("姓名输入有误");
$(".layerbigb").css("display", "block");
return false
}
//正则匹配身份证号
var pattern_id = /\d{17}[\d|x]|\d{15}/;
if(!pattern_id.test(idcard_no)){
$(".layerbigb .titlemsg").text("身份证号输入有误");
$(".layerbigb").css("display", "block");
return false
}