Created
June 18, 2015 13:36
-
-
Save lymanlai/0e08f5f337404b587da0 to your computer and use it in GitHub Desktop.
mobile validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkMobile(){ | |
var sMobile = document.mobileform.mobile.value | |
if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(sMobile))){ | |
alert("不是完整的11位手机号或者正确的手机号前七位"); | |
document.mobileform.mobile.focus(); | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment