给注册用户填写和修改密码增加“密码强度”的方法(3)_动易Cms教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

Response.Write " function ignoreError(){return true;}" & vbCrLf
Response.Write " function EvalPwdStrength(oF,sP){" & vbCrLf
Response.Write " PadPasswd(oF,sP.length*2);" & vbCrLf
Response.Write " if(ClientSideStrongPassword(sP,gSimilarityMap,gDictionary)){DispPwdStrength(3,'cssStrong');}" & vbCrLf
Response.Write " else if(ClientSideMediumPassword(sP,gSimilarityMap,gDictionary)){DispPwdStrength(2,'cssMedium');}" & vbCrLf
Response.Write " else if(ClientSideWeakPassword(sP,gSimilarityMap,gDictionary)){DispPwdStrength(1,'cssWeak');}" & vbCrLf
Response.Write " else{DispPwdStrength(0,'cssPWD');}" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write " function PadPasswd(oF,lPwd){" & vbCrLf
Response.Write " if(typeof oF.PwdPad=='object'){var sPad='IfYouAreReadingThisYouHaveTooMuchFreeTime';var lPad=sPad.length-lPwd;oF.PwdPad.value=sPad.substr(0,(lPad<0)?0:lPad);}" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write " function DispPwdStrength(iN,sHL){" & vbCrLf
Response.Write " if(iN>3){ iN=3;}for(var i=0;i<4;i ){ var sHCR='cssPWD';if(i<=iN){ sHCR=sHL;}if(i>0){ GEId('idSM' i).className=sHCR;}GEId('idSMT' i).style.display=((i==iN)?'inline':'none');}" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write " function GEId(sID){return document.getElementById(sID);}" & vbCrLf
//-->
Response.Write " </script>" & vbCrLf
Response.Write " <style>" & vbCrLf
Response.Write " input{FONT-FAMILY:宋体;FONT-SIZE: 9pt;}" & vbCrLf
Response.Write " .cssPWD{background-color:#EBEBEB;border-right:solid 1px #BEBEBE;border-bottom:solid 1px #BEBEBE;}" & vbCrLf
Response.Write " .cssWeak{background-color:#FF4545;border-right:solid 1px #BB2B2B;border-bottom:solid 1px #BB2B2B;}" & vbCrLf
Response.Write " .cssMedium{background-color:#FFD35E;border-right:solid 1px #E9AE10;border-bottom:solid 1px #E9AE10;}" & vbCrLf
Response.Write " .cssStrong{background-color:#3ABB1C;border-right:solid 1px #267A12;border-bottom:solid 1px #267A12;}" & vbCrLf
Response.Write " .cssPWT{width:132px;}" & vbCrLf
Response.Write " </style>" & vbCrLf
Response.Write " <table cellpadding='0' cellspacing='0' class='cssPWT' style='height:16px'>" & vbCrLf
Response.Write " <tr valign='bottom'>" & vbCrLf
Response.Write " <td id='idSM1' class='cssPWD' align='center'>" & vbCrLf
Response.Write " <span style='font-size:1px'>&nbsp;</span>" & vbCrLf
Response.Write " <span id='idSMT1' style='display:none;'>弱</span></td><td id='idSM2' class='cssPWD' align='center' style='border-left:solid 1px #fff'><span style='font-size:1px'>&nbsp;</span><span id='idSMT0' style='display:inline;font-weight:normal;color:#666'>无</span><span id='idSMT2' style='display:none;'>中</span></td><td id='idSM3' class='cssPWD' align='center' style='border-left:solid 1px #fff'><span style='font-size:1px'>&nbsp;</span><span id='idSMT3' style='display:none;'>强</span></td>" & vbCrLf

查看更多 动易Cms教程  动易Cms模板

来源:模板无忧//所属分类:动易Cms教程/更新时间:2006-09-18
相关动易Cms教程