if (start == "0") {
cellphone = cellphone.substring(1);
} else {
break;
}
}
$("#cellphone").val(cellphone);
if (cellphone == null || cellphone == "") {
$("#cellphoneMsg").html("<span class='tips'>请输入移动电话号码</span>");
cellphoneFlag = 1;
return;
}
var re = /^1{1}[3,4,5,8]{1}d{9}$/; // 判断是否为数字的正则表达式
if (!re.test(cellphone)) {
cellphoneFlag = 1;
$("#cellphoneMsg").html("<span class='tips'>请输入正确的移动电话号码</span>");
return;
} else {
cellphoneFlag = 0;
$("#cellphoneMsg").html("");
}
}
function check_homephone()
{
$("#showSpan").hide();
var homephone = $.trim($("#homephone").val());
if(homephone == null || homephone == "")
{
homephoneFlag=0;
$("#homephoneMsg").html("");
return ;
}
var re=/(^(d{3,4}-)?d{7,8})$|(^1{1}[3,4,5,8]{1}d{9}$)/;
if(!re.test(homephone))
{
homephoneFlag=1;
$("#homephoneMsg").html("<span class='tips'>请正确输入电话号码,格式为: 000-00000000</span>");
return ;
}else
{
homephoneFlag=0;
$("#homephoneMsg").html("");
}
}
function check_address()
{
$("#showSpan").hide();
var address = $.trim( $("#address").val());
// 判断是否为空
if(address == null || address == "")
{
$("#addressMsg").html("<span class='tips'>请输入详细地址</span>");
addressFlag = 1;
}else
if (address.replace(/[^x00-xff]/g, "**").length > 120) {
addressFlag = 1;
$("#addressMsg").html("<span class='tips'>长度超长</span>");
} else {
addressFlag = 0;
$("#addressMsg").html("");
}
}
function check_zip()
{
$("#showSpan").hide();
var zip=$.trim($("#zip").val());
var re=/^[0-9]+$/;
if(zip.length != 0 && (!re.test(zip) || zip.length != 6))
{
zipFlag=1;
$("#zipMsg").html("<span class='tips'>请输入邮政编码,由6位数字组成</span>");
}else
{
zipFlag=0;
$("#zipMsg").html("");
}
}
function check_oldPassword()
{
$("#msgSpan").html("");
$("#newpsMsg").html("");
$("#repsMsg").html("");
var oldPS = $.trim($("#oldPassword").val());
if(oldPS == null || oldPS == "")
{
oldpasswordFlag = 1;
$("#oldpsMsg").html("<span class='tips'>请输入旧密码</span>");
$(this).focus();
return false;
}
var re=/^.{6,16}$/;
if(!re.test(oldPS))
{
oldpasswordFlag = 1;
$("#oldpsMsg").html("<span class='tips'>旧密码输入长度不正确</span>");
$(this).focus();










