html+css+jquery实现注册表单的验证
发表日期: 2020-08-01 11:11:03 浏览次数:229
湘西百度爱采购网站推广电话、湘西百度爱采购广告收费标准多少钱、湘西百度爱采购代理服务商找哪家好、湘西百度爱采购会员费一年需要多少钱、湘西百度爱采购商家服务如何推广【湘西百度爱采购广告推广咨询服务】
湘西土家族苗族自治州,首府驻吉首市,是湖南的14个地级行政区之一。位于湖南省西北部,介于东经109°10′~110°22.5′,北纬27°44.5′~29°38′之间,地处湘、鄂、黔、渝四省市交界处。
1952年8月成立湘西苗族自治区,1955年改为湘西苗族自治州,1957年9月成立湘西土家族苗族自治州。管辖7县1市,面积15462平方公里。湘西州属亚热带季风湿润气候,具有明显的大陆性气候特征。
2018年,全州常住人口264.95万人。其中城镇人口123.3万人,农村人口141.65万人。以土家族、苗族为主的少数民族占77.21%。2018年,湘西州实现生产总值605.05亿元,增长6%。
湘西州历史悠久,文化灿烂,辖区内有首批国家历史文化名城凤凰县,2015年入选首批国家全域旅游示范区,州内人文古迹众多,老司城及其周边有大量的自然及人文景观遗迹。湘西也是武陵文化的发源地之一。
html+css+jquery实现注册表单的验证
新建html文档。
书写html。
<div class="reg_div">
<p>注册</p>
<ul class="reg_ul">
<li>
<span>用户名:</span>
<input type="text" name="" value="" placeholder="4-8位用户名" class="reg_user">
<span class="tip user_hint"></span>
</li>
<li>
<span>密码:</span>
<input type="password" name="" value="" placeholder="6-16位密码" class="reg_password">
<span class="tip password_hint"></span>
</li>
<li>
<span>确认密码:</span>
<input type="password" name="" value="" placeholder="确认密码" class="reg_confirm">
<span class="tip confirm_hint"></span>
</li>
<li>
<span>邮箱:</span>
<input type="text" name="" value="" placeholder="邮箱" class="reg_email">
<span class="tip email_hint"></span>
</li>
<li>
<span>手机号码:</span>
<input type="email" name="" value="" placeholder="手机号" class="reg_mobile">
<span class="tip mobile_hint"></span>
</li>
<li>
<button type="button" name="button" class="red_button">注册</button>
</li>
</ul>
</div>
书写css样式。
<style>
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, button { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; font-family: "微软雅黑"; text-decoration: none; color: #000; }
body { min-width: 1200px; }
a:hover { text-decoration: none; }
input { outline: none; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
body { line-height: 1; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }
body { background-color: #333; }
.reg_div { margin: auto; width: 500px; height: 500px; border: 1px solid #333; border-radius: 5px; text-align: center; margin-top: 20px; background-color: #ffffff; }
.reg_div p { padding: 30px 0px; font-size: 30px; }
.reg_ul { width: 100%; }
.reg_ul li { margin: auto; overflow: hidden; width: 100%; margin-top: 10px; }
.reg_ul li span { float: left; width: 100px; text-align: right; display: inline-block; margin: auto; margin-left: 30px; margin-top: 10px; }
.reg_ul li span.tip { margin: 6px 0 0 10px; width: 40px; text-align: left; }
.reg_ul li input { float: left; width: 228px; height: 30px; border: 1px solid #333; border-radius: 3px; padding-left: 20px; outline: medium; margin-left: 10px; }
.reg_ul li button { margin: auto; color: #ffffff; background-color: #333; font-size: 16px; padding: 10px 60px; outline: inherit; border-radius: 3px; cursor: pointer; margin-top: 10px; }
</style>
添加并引用js。
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
书写script.js。
var user_Boolean = false;
var password_Boolean = false;
var varconfirm_Boolean = false;
var emaile_Boolean = false;
var Mobile_Boolean = false;
$('.reg_user').blur(function(){
if ((/^[a-z0-9_-]{4,8}$/).test($(".reg_user").val())){
$('.user_hint').html("✔").css("color","green");
user_Boolean = true;
}else {
$('.user_hint').html("×").css("color","red");
user_Boolean = false;
}
});
$('.reg_password').blur(function(){
if ((/^[a-z0-9_-]{6,16}$/).test($(".reg_password").val())){
$('.password_hint').html("✔").css("color","green");
password_Boolean = true;
}else {
$('.password_hint').html("×").css("color","red");
password_Boolean = false;
}
});
$('.reg_confirm').blur(function(){
if (($(".reg_password").val())==($(".reg_confirm").val())){
$('.confirm_hint').html("✔").css("color","green");
varconfirm_Boolean = true;
}else {
$('.confirm_hint').html("×").css("color","red");
varconfirm_Boolean = false;
}
});
$('.reg_email').blur(function(){
if ((/^[a-z\d]+(\.[a-z\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[a-z]+)+$/).test($(".reg_email").val())){
$('.email_hint').html("✔").css("color","green");
emaile_Boolean = true;
}else {
$('.email_hint').html("×").css("color","red");
emaile_Boolean = false;
}
});
$('.reg_mobile').blur(function(){
if ((/^1[34578]\d{9}$/).test($(".reg_mobile").val())){
$('.mobile_hint').html("✔").css("color","green");
Mobile_Boolean = true;
}else {
$('.mobile_hint').html("×").css("color","red");
Mobile_Boolean = false;
}
});
$('.red_button').click(function(){
if(user_Boolean && password_Boolea && varconfirm_Boolean && emaile_Boolean && Mobile_Boolean == true){
alert("注册成功");
}else {
alert("请完善信息");
}
});
页面整体代码结构。
查看效果。
7 月 31 日消息 今日路透社报道称,中国反垄断部门在研究是否对微信支付和支付宝展开反垄断调查。
现据 21 世纪经济报道,记者就此事向国家市场监督管理总局相关人士、反垄断领域的核心专家等求证,相关人士均表示,没有听说报道中所指的调查,不清楚路透社的信源来自哪里。受访的多位人士表示:反垄断调查是非常严肃的事情,需要进行立案程序之后才会进行,会有严格审批的程序。
早前路透社的报道称,知情人士表示,一个多月以来,国务院反垄断委员会一直在收集关于阿里巴巴集团旗下支付宝和腾讯控股有限公司旗下微信支付的信息。消息人士表示,反垄断委员会尚未就是否进行调查做出决定,也不清楚何时会做出决定。一位消息人士表示,委员会 “非常认真”地对待央行给出的建议。
而对此,支付宝和微信支付相关人士均表示尚不清楚该消息。
湘西百度爱采购网站推广电话、湘西百度爱采购广告收费标准多少钱、湘西百度爱采购代理服务商找哪家好、湘西百度爱采购会员费一年需要多少钱、湘西百度爱采购商家服务如何推广【湘西百度爱采购广告推广咨询服务】