1 <script type="text/javascript"> 2 function Check() { 3 var phoneNumber = $.trim($("#PhoneNumber").val()); 4 var isMobile=/^1?(3|5|7|8)\d{9}$/; 5 if (isMobile.test(phoneNumber) == false) { 6 alert("电话号码格式错误"); 7 $("#PhoneNumber").focus(); 8 return false; 9 } 10 return true; 11 } 12 </script> 13 <input type="submit" name="addNewAddress" value="保存收货地址" class="saveNewAddress" onclick="return Check();"/>
时间: 2024-10-25 23:31:29