日期:2014-05-16 浏览次数:20360 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled</title> <script type="text/Javascript"> var NUMTEST = /[0-9]/; var LETTERTEST = /[a-zA-Z]/; var OTHERTEST = /[^a-zA-Z0-9]/; window.onload = function(){ var tip = document.getElementById('tip'); var psd = document.getElementById('psd'); psd.onkeyup = function(){ var hasNum = NUMTEST.test(this.value); var hasLetter = LETTERTEST.test(this.value); var hasOther = OTHERTEST.test(this.value); tip.innerHTML = hasNum ? (hasLetter? (hasOther? '强':'中'):(hasOther? '中':'弱')):(hasLetter? (hasNum?('中'):('弱')):(hasOther?('弱'):(''))); } } </script> </head> <body> <div id="main"> <label>password:<input id="psd" name="psd" type="password" /></label> <span id="tip"></span> </div> </body> </html>
------解决方案--------------------
搜索google
js验证 安全级别
很多种方法
------解决方案--------------------
前台最好使用SSL技术