1function checkregemail(email){ 2 var str=email; 3 var Expression=/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/; 4 var objExp=new RegExp(Expression); 5 if(objExp.test(str)==true){ 6 return true; 7 }else{ 8 return false; 9 } 10} 11 12function checkpwd(pwd){ 13 var str=pwd; 14 var Expression=/^[a-zA-Z0-9]{4,15}$/; 15 var objExp=new RegExp(Expression); 16 if(objExp.test(str)==true){ 17 return true; 18 }else{ 19 return false; 20 } 21} 22 23function chkreginfo(form, mark){ 24 25 26 if(mark==1 || mark=="all"){ 27 if(form.fname.value==""){ 28 msg.innerHTML="* Please input your first name."; 29 form.fname.style.backgroundColor="#eee"; 30 return false; 31 } else if(form.fname.value.length>25){ 32 msg.innerHTML="* Must be shorter than 25 characters."; 33 form.fname.style.backgroundColor="#eee"; 34 return false; 35 }else{ 36 msg.innerHTML=""; 37 form.fname.style.backgroundColor="#fff"; 38 } 39 } 40 41 if(mark==2 || mark=="all"){ 42 if(form.lname.value==""){ 43 msg.innerHTML="* Please input your last name."; 44 form.lname.style.backgroundColor="#eee"; 45 return false; 46 }else if(form.lname.value.length>25){ 47 msg.innerHTML="* Must be shorter than 25 characters."; 48 form.lname.style.backgroundColor="#eee"; 49 return false; 50 }else{ 51 msg.innerHTML=""; 52 form.lname.style.backgroundColor="#fff"; 53 } 54 } 55 56 if(mark==3 || mark=="all"){ 57 if(form.email.value==""){ 58 msg.innerHTML="* Please input your email address."; 59 form.email.style.backgroundColor="#eee"; 60 return false; 61 }else if(!checkregemail(form.email.value)){ 62 msg.innerHTML="* The format of your email is not correct."; 63 form.email.style.backgroundColor="#eee"; 64 return false; 65 }else{ 66 msg.innerHTML=""; 67 form.email.style.backgroundColor="#fff"; 68 } 69 } 70 71 if(mark==4 || mark=="all"){ 72 if(form.org.value==""){ 73 msg.innerHTML="* Please input your oranization name."; 74 form.org.style.backgroundColor="#eee"; 75 return false; 76 }else if(form.org.value.length>60){ 77 msg.innerHTML="*Must be shorter than 60 characters."; 78 form.org.style.backgroundColor="#eee"; 79 return false; 80 }else{ 81 msg.innerHTML=""; 82 form.org.style.backgroundColor="#fff"; 83 } 84 } 85 86 87 88 if(mark==5 || mark=="all"){ 89 if(form.pwd.value==""){ 90 msg.innerHTML="*Please input your password."; 91 form.pwd.style.backgroundColor="#eee"; 92 return false; 93 }else if(!checkpwd(form.pwd.value)){ 94 msg.innerHTML="*Must be 5-16 characters. May contain letters, numbers and underscore."; 95 form.pwd.style.backgroundColor="#eee"; 96 return false; 97 }else{ 98 msg.innerHTML=""; 99 form.pwd.style.backgroundColor="#fff"; 100 } 101 } 102 103 if(mark==6 || mark=="all"){ 104 if(form.pwd1.value==""){ 105 msg.innerHTML="*Please confirm your password."; 106 form.pwd1.style.backgroundColor="#eee"; 107 return false; 108 }else if(form.pwd1.value!=form.pwd.value){ 109 msg.innerHTML="*Inconsistent password. Please input again."; 110 form.pwd1.style.backgroundColor="#eee"; 111 return false; 112 }else{ 113 msg.innerHTML=""; 114 form.pwd1.style.backgroundColor="#fff"; 115 } 116 } 117 118 if(mark==7 || mark=="all"){ 119 if(form.code.value==""){ 120 msg.innerHTML="*Empty validation code."; 121 form.code.style.backgroundColor="#eee"; 122 return false; 123 }else if(form.code.value!=form.vcode.value){ 124 msg.innerHTML="*Wrong validation code."; 125 form.code.style.backgroundColor="#eee"; 126 return false; 127 }else{ 128 msg.innerHTML=""; 129 form.code.style.backgroundColor="#fff"; 130 } 131 } 132 133 134 } 135
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.