Js registration user information verification (good user experience)

Source: Internet
Author: User
Tip: you can modify some code before running

Js registration user information verification (good user experience)<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.111cn.net/1999/xhtml"><head><meta http-equiv="content-type" content="text/html; charset=gb2312" /><title>Js registration user information verification (good user experience)</title></head><body><form name="form1" method="post" action="index.aspx" id="form1" onsubmit="return check_input();"><div><input type="hidden" name="__viewstate" id="__viewstate" value="/wepdwujmtg5otk4ndi1zbgbbr5fx0nvbnryb2xzumvxdwlyzvbvc3rcywnrs2v5x18wawufy3rsmdafbwn0bdaxbqlidg5uawppyw/6royhjn+wkt9u5ba5csi9eal64a==" /></div><div><input type="hidden" name="__eventvalidation" id="__eventvalidation" value="/wewbgkr9zx5aqlgkv2sawkcyv2sawk96fbycql9l9vqbqkygfnld6szpvbngrc6agkdno+ezqjkp41p" /></div> <div class="jrjhcontent"> <ul> <li>1. The frequency of your access to Soufun in the last 6 months is (required )*</li> <li><input type="radio" name="rate" value="每天访问" />Daily access</li> <li><input type="radio" name="rate" value="每周访问4-5次" />4-5 visits per week</li> <li><input type="radio" name="rate" value="每周访问1-3次" />1-3 visits per week</li> <li><input type="radio" name="rate" value="每月访问2-3次" />2-3 visits per month</li> <li><input type="radio" name="rate" value="每月访问1次及1次以下" />Once a month or less</li> </ul> <ul> <li>2. What information do you want to obtain through SouFun (multiple options )*</li> <li><input type="checkbox" name="info" value="查找新房、二手房或租房房源" />Find new houses, second-hand houses, or rental houses</li> <li><input type="checkbox" name="info" value="查找楼盘打折信息" />Find discount information</li> <li><input type="checkbox" name="info" value="查找建材家具折扣信息" />Find discount information for building materials and furniture</li> <li><input type="checkbox" name="info" value="查看房地产行业信息、相关市场动态、新闻资讯等" />View real estate industry information, market news, news, etc.</li> <li><input type="checkbox" name="info" value="查找其他网友评价" />Search for comments from other users</li> <li><input type="checkbox" name="info" value="查找小区相关信息" />Find information about a residential area</li> <li><input type="checkbox" name="info" value="发布二手房、租房信息" />Publish information on second-hand houses and rental houses</li> <li><input type="checkbox" name="info" value="使用房贷计算器、房产评估等工具" />Use mortgage calculator, real estate assessment, and other tools</li> <li><input type="checkbox" name="info" value="查找家居装修相关信息" />Find Home decoration information</li> <li><input type="checkbox" id="ckbinfo" name="info"/>Others<input type="text" id="qita1" name="qita1"/> </li> </ul> <ul> <li>3. Which of the following SouFun products or services have you used )*</li> <li><input type="checkbox" name="service" value="新房频道,查找新房相关信息" />New House channel, find new house information</li> <li><input type="checkbox" name="service" value="二手房频道,查找或发布二手房相关信息" />Second-hand housing channels to find or publish second-hand housing information</li> <li><input type="checkbox" name="service" value="租房频道,查找或发布租房相关信息" />Rental channels to find or publish rental information</li> <li><input type="checkbox" name="service" value="业主论坛,与其他业主交流" />Owners' Forum to communicate with other owners</li> <li><input type="checkbox" name="service" value="装修论坛,获得或分享装修相关信息" />Decoration forum to get or share decoration information</li> <li><input type="checkbox" name="service" value="家居频道,查找建材、家具等信息" />Home channel, search for building materials, furniture, and other information</li> <li><input type="checkbox" name="service" value="搜房帮或经纪人" />SouFun helper or broker</li> <li><input type="checkbox" name="service" value="商铺频道" />Shop Channel</li> <li><input type="checkbox" name="service" value="写字楼频道" />Office Channel</li> <li><input type="checkbox" id="ckbservice" name="service"/>Others<input type="text" id="qita2" /> </li> </ul> <ul> <li>4. Your gender (required )*</li> <li><input value="男" name="sex" type="radio" />Male</li> <li><input value="女" name="sex" type="radio" />Female</li> </ul> <ul> <li>5. Your age (required )*</li> <li><input type="radio" name="age" value="28岁以下" />Under 28 years old</li> <li><input type="radio" name="age" value="28-35岁" />28-35 years old</li> <li><input type="radio" name="age" value="36-45岁" />36-45 years old</li> <li><input type="radio" name="age" value="46-60岁" />46-60 years old</li> <li><input type="radio" name="age" value="60岁以上" />Over 60 years old</li> </ul> <ul> <li>6. Your network age is probably</li> <li><input type="radio" id="netage" name="netage" value="1年以下" />Less than 1 year</li> <li><input type="radio" name="netage" value="1-5年" />1-5 years</li> <li><input type="radio" name="netage" value="6-10年" />6-10 years</li> <li><input type="radio" name="netage" value="11年以上" />More than 11 years</li> </ul> <ul> <li>7. Your Name (required )*</li> <li><input type="text" id="name" name="name" value="" class="btn01"/> </li> </ul> <ul> <li class="font_w">8. Your contact address</li> <li><input type="text" id="address" name="address" class="btn01"/> </li> </ul> <ul> <li>9. Your contact number (required )*</li> <li><input type="text" id="phone" name="phone" value="" class="btn01" /> </li> <li >Please fill in your mobile phone number or landline phone number. We will use this to contact you when we invite you to participate in user experience activities.</li> </ul> <ul> <li>10. Your email address</li> <li><input type="text" id="email" name="email" class="btn01" /> </li> </ul> </div> <div class="jrjhcontentss"><input name="btntijiao" id="btntijiao" src="yun_qi_img/20100701004150373.jpg" /> <input type="hidden" name="hd1" id="hd1" /> <input type="hidden" name="hd2" id="hd2" /> </div> </form> <script language="javascript" type="text/javascript">Function $ (obj) {return document. getelementsbyname (obj);} function c (obj) {return document. getelementbyid (obj);} function turnto (obj) {c (obj ). scrollintoview (true);} function check_input () {// frequency c ('errorrate '). innerhtml = ""; var rate = $ ('rate'); var r1 = 0; for (var j = 0; j<rate.length;j++) { if(rate[j].checked) { r1++; } } if(r1==0) { c('errorrate').innerhtml="此项不能为空"; turnto('rate'); return false; } //获得信息 c('errorinfo').innerhtml=""; c('errorqita1').innerhtml=""; var info=$('info'); var i1=0; var result=""; for(var l=0; l<info.length-1; l++) { if(info[l].checked==true) { i1++; result=result+info[l].value+";"; } } if(info[info.length-1].checked) { if(c('qita1').value!="") { result=result+"其他:"+c('qita1').value+";"; } else { c('errorqita1').innerhtml="请输入内容"; turnto('info'); return false; } } if(i1==0) { c('errorinfo').innerhtml="此项不能为空"; turnto('info'); return false; } else { c('hd1').value=result; } //服务 c('errorservice').innerhtml=""; c('errorqita2').innerhtml=""; var ser=$('service'); var service=""; var s1=0; for(var s=0; s<ser.length-1; s++) { if(ser[s].checked==true) { s1++; service=service+ser[s].value+";"; } } if(ser[ser.length-1].checked) { if(c('qita2').value!="") { service=service+"其他:"+c('qita2').value+";"; } else { c('errorqita2').innerhtml="请输入内容"; turnto('service'); return false; } } if(s1==0) { c('errorservice').innerhtml="此项不能为空"; turnto('service'); return false; } else { c('hd2').value=service; } //性别 c('errorsex').innerhtml=""; var sex=$('sex'); var s1=0; for(var k=0;k<sex.length;k++) { if(sex[k].checked) { s1++; } } if(s1==0) { c('errorsex').innerhtml="此项不能为空";// c('sex').focus(); turnto('sex'); return false; } //年龄 c('errorage').innerhtml=""; var b=$('age'); var j=0; for(var i=0;i<b.length;i++) { if(b[i].checked) { j++; } } if(j==0) { c('errorage').innerhtml="此项不能为空";// c('age').focus(); turnto('age'); return false; } //网龄// c('errornetage').innerhtml="";// var net=$('netage');// var n1=0;// for(var n=0;n<net.length;n++)// {// if(net[n].checked)// {// n1++;// }// }// if(n1==0)// {// c('errornetage').innerhtml="此项不能为空";// c('netage').focus();// return false;// // } //姓名 c('errorname').innerhtml=""; var textname=c('name').value.replace(/(^s*)|(s*$)/g, ""); if(textname=="") { c('errorname').innerhtml="此项不能为空"; c('name').focus(); return false; } c('errorphone').innerhtml=""; var textphone=c('phone').value.replace(/(^s*)|(s*$)/g, ""); if(textphone=="") { c('errorphone').innerhtml="此项不能为空"; c('phone').focus(); return false; } c('errorphone').innerhtml=""; if(c('phone').value!="") { var tel=/^(+)*(d{0,2}-)*((d{3}|d{4})-)*(d{8}|d{7})$/; var phone=/^(+)*(d{0,2}-)*0{0,1}(13[0-9]|15[7-9]|153|156|18[7-9])[0-9]{8}$/; if(!phone.test(c('phone').value)&&!tel.test(c('phone').value)) { c('errorphone').innerhtml="电话格式错误"; c('phone').focus(); return false; } } c('erroremail').innerhtml=""; if(c('email').value!="") { var filter=/^w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*$/; if(!filter.test(c('email').value)) { c('erroremail').innerhtml="邮箱格式错误"; c('email').focus(); return false; } } }</script></body></html>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.