日期:2014-05-16 浏览次数:20516 次
function checkCompanyAbbreviation(){
var zhimu=/^[A-Za-z]+$/
var re=/^[0-9]+$/
var chinese=/^[\w\u4E00-\u9FA5]+$/
var companyabbreviation=$("#companyabbreviationid").val();
if(companyabbreviation.length != 0){
if(20 < companyabbreviation.length | companyabbreviation.length < 1){
$("#companyabbreviationmsg").html("<font style='color:red;'>*公司简称长度应为(1-20位)</font>");
return false;
} else if(companyabbreviation.indexOf(" ")!=-1){
$("#companyabbreviationmsg").html("<font style='color:red;'>*公司简称不能包含空格</font>");
return false;
}else if(re.test(companyabbreviation)){
$("#companyabbreviationmsg").html("<font style='color:green;font-size: 18px;'> *公司简称不能为纯数字</font>");
return false;
}else if(zhimu.test(companyabbreviation)){
$("#companyabbreviationmsg").html("<font style='color:green;font-size: 18px;'> *公司简称不能为纯字母</font>");
return false;
}else if(chinese.test(companyabbreviation)){
$("#companyabbreviationmsg").html("<font style='color:green;font-size: 18px;'> √</font>");
return true;
}else{
$("#companyabbreviationmsg").html("<font style='color:red;'>*公司简称只能为中文或英文字母及数字</font>");
return false;
}
}else{
$("#companyabbreviationmsg").html("<font style='color:green;font-size: 18px;'> √</font>");
return true;
//$("#name").select();
}
}