$('#create_membership').click(function () {
var zip = $('#zip').val();
else if (zip == ''){
errorMessage = "*Zipcode required!";
}
else if ((zip.length)< 5 || (zip.length)>5 ){
errorMessage = "*zipcode should only be 5 digits";
}
else if ( zip =( "^[0-9]+$" )){
errorMessage = "*zipcode should be numbers only";
}
我得到了第一个和第二个,即邮政编码的空和长度验证。但是对于第三种情况,号码验证不起作用。任何人都可以帮助我获得号码验证提前谢谢