<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>填写资料</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="apple-touch-icon-precomposed" href="https://res.zhen.com/mzhenpin/statics/image/apple_logo.png" />
<script>
(function(doc, win) {
var htmlFont = function() {
var docEl = doc.documentElement,
l = docEl.clientWidth,
f;
f = l / 15;
l > 750 ? docEl.style.fontSize = 50 + "px" : docEl.style.fontSize = f + "px"
};
htmlFont();
win.addEventListener("resize", htmlFont, false)
})(document, window)
</script>
<style>
* {
padding: 0px;
margin: 0px;
}
html,
body {
width: 100%;
height: 100%;
}
body {
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
font-family: sans-serif;
font-size: 0.24rem;
}
table {
border-spacing: 0px;
border-collapse: collapse;
}
td,
th {
overflow-wrap: break-word;
}
img,
fieldset {
border: none;
display: block;
}
img {
width: 100%;
}
input,
select,
textarea {
vertical-align: middle;
border: 0px none;
display: block;
outline: none;
}
header,
nav,
section,
footer {
display: block;
}
a {
text-decoration: none;
display: block;
color: rgb(49, 49, 49);
}
input[type="submit"],
input[type="reset"],
input[type="search"],
input[type="button"],
button,
textarea {
-webkit-appearance: none;
}
h1,
h2,
h3,
h4,
h5,
h6,
strong {
font-weight: normal;
}
em,
var {
font-style: normal;
}
.bgbody {
min-width: 6.4rem;
width: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
font-family: sans-serif;
overflow-y: auto;
/*background-color: #f3f3f3;*/
margin-bottom: 1rem;
}
.df-box {
min-width: 320px;
max-width: 750px;
width: 100%;
margin: 0px auto;
overflow: hidden;
clear: both;
color: rgb(102, 102, 102);
}
.ys_name {
text-align: center;
margin-top: 0.7rem;
font-size: 0.4rem;
color: rgb(29, 29, 29);
}
.head-1 {
width: 15rem;
height: 12.4rem;
}
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
/*增加底部适配层*/
.bb-fixed {
bottom: 0 !important;
}
.bb-fixed :after {
content: '';
z-index: 9998;
position: fixed;
left: 0;
bottom: -1.5rem;
width: 100%;
height: 1.5rem;
background-color: #fff;
}
.bottom-fixed {
bottom: 1.7rem!important;
}
.bgbody {
padding-bottom: 3rem!important;
}
.fixd-box {
bottom: 4rem!important;
}
}
/*填写资料*/
.datum{
color:#b2b2b2 ;
font-size: .52rem;
margin: 0 1.4rem;
position: relative;
}
.datum input{
width: 12.4rem;
border-bottom: .02rem solid #eee;
}
::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color: #b2b2b2;
font-size: .52rem;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #b2b2b2;
font-size: .52rem;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #b2b2b2;
font-size: .52rem;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #b2b2b2;
font-size: .52rem;
}
.datum .name{
padding-top:2.8rem ;
padding-bottom: .7rem;
}
.datum .ID-number{
padding: .7rem 0;
}
.datum .phone-number{
padding: .7rem 0;
}
.datum .greet{
padding: .7rem 0;
}
.datum .de{
width: 3.68rem;
height: 1.04rem;
border:.5px solid #b2b2b2;
font-size: .48rem;
border-radius: .56rem;
background: #fff;
color: #999;
position: absolute;
top: 8.64rem;
right: .2rem;
text-align: center;
line-height: 1.14rem;
}
.datum p{
color: #d21034;
font-size: .48rem;
text-align: center;
margin-top: 1.6rem;
}
.datum .button{
color: #fff;
font-size: .56rem;
width: 12.2rem;
height: 1.6rem;
background: #ccc;
border-radius: 1.6rem;
margin-top: .8rem;
text-align: center;
line-height: 1.6rem;
}
input{
overflow:hidden;
}
#spanid{
width: 7rem;
height: 1.4rem;
position: absolute;
top: 6rem;
right: 2rem;
opacity: 0.5;
background-color: #ccc;
color: #b2b2b2;
text-align: center;
line-height: 1.4rem;
}
</style>
</head>
<body>
<div class="bgbody">
<div class="df-box">
<!--填写资料-->
<div class="datum">
<input type="text" name="username" class="name" id="username" placeholder='真实姓名'>
<input class="ID-number" id="ID-number" placeholder='身份证号'>
<input class="phone-number" id="telephone" placeholder='手机号码'>
<input class="greet" placeholder='验证码'>
<div id="spanid" style="display: none;"></div>
<div class="de" id="btnSendCode" onclick="sendMessage()">获取验证码</div>
<p>单日最多发送5条验证短信</p>
<div class="button">提交</div>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="https://res.zhen.com/mzhenpin/statics/js/zepto.js"></script>
<script type="text/javascript" src="https://res.zhen.com/mzhenpin/statics/js/lazyLoad.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script type="text/javascript" src="https://res.zhen.com/mzhenpin/statics/js/public_activity.js"></script>
<script type="text/javascript" src="https://res.zhen.com/mzhenpin/statics/js/iscroll-1.5.js"></script>
<script type="text/javascript" src="https://res.zhen.com/mzhenpin/statics/js/m_code.js"></script>
<script type="text/javascript" src="https://res.zhen.com/mzhenpin/statics/decoration/pro/js/custom_sellout_outline.js"></script>
<script>
// 真实姓名验证
function isChinaName(name) {
var pattern = /^[\u4E00-\u9FA5]{1,6}$/;
return pattern.test(name);
}
// 身份证号码验证
function isCardNo(card) {
var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
return pattern.test(card);
}
// 手机号码验证
function isPhoneNo(phone) {
var pattern = /^1[34578]\d{9}$/;
return pattern.test(phone);
}
/*用户名判断*/
function userName(inputid) {
$(inputid).blur(function() {
if ($.trim($(inputid).val()).length != '') {
return true;
} else {
alert('请输入真实姓名')
return false;
}
});
$(inputid).focus(function() {
return false;
});
};
userName('#username');
/*身份证判断*/
function userID(inputid) {
// window.alert = function(){ return false; }
$(inputid).blur(function() {
if ($.trim($(inputid).val()).length == '') {
alert('请输入身份证号码');
return false;
} else {
if (isCardNo($.trim($(inputid).val())) == false) {
alert('身份证号码格式错误');
return false;
}
}
});
$(inputid).focus(function() {
return false;
});
};
userID('#ID-number');
/*手机号判断*/
function userTel(inputid) {
$(inputid).blur(function() {
if ($.trim($(inputid).val()).length == 0) {
alert('请输入手机号码');
return false;
} else {
if (isPhoneNo($.trim($(inputid).val())) == false) {
alert('手机号格式错误');
return false;
}
}
$(inputid).focus(function() {
return true;
});
});
};
userTel('#telephone');
</script>
</html>```
..你给的这个提问方式也太粗糙了吧...
你直接在ide中搜索下有哪些地方有alert的,看看怎么触发的。再说