»
EnglishFrenchVietnamese

Print - Safe of Password - JavaScriptBank.com

Full version: jsB@nk » Security » Passwordor » Safe of Password
URL: https://www.javascriptbank.com/safe-of-password.html

Safe of Password © JavaScriptBank.comThis JavaScript code will check the safe of JavaScript password that you type in and display safety level of this password.

Full version: jsB@nk » Security » Passwordor » Safe of Password
URL: https://www.javascriptbank.com/safe-of-password.html



JavaScript
<script>// Source: <a href="http://games.vietnamnet.vn/">http://games.vietnamnet.vn/function isNumber(string){var strs="123456789~!@#$%^&*()_";for (var k=0;k<string.length;k++)if (strs.indexOf(string.charAt(k))==-1)return false;return true;}function isChar(string){var strs="QWERTYUIOPLKJHGFDSAZXCVBNMqwertyuiopasdfghjklzxcvbnm~!@#$%^&*()_";for (var k=0;k<string.length;k++)if (strs.indexOf(string.charAt(k))==-1)return false;return true;}function isSpecial(string){var strs="QWERTYUIOPLKJHGFDSAZXCVBNMqwertyuiopasdfghjklzxcvbnm0123456789";for (var k=0;k<string.length;k++)if (strs.indexOf(string.charAt(k))==-1)return false;return true;}function showred(){var the_div = window.red.style;the_div.visibility="visible";}function hidered(){var the_div = window.red.style;the_div.visibility="hidden";the_div}function showyellow(){var the_div = window.yellow.style;the_div.visibility="visible";}function hideyellow(){var the_div = window.yellow.style;the_div.visibility="hidden";}function showgreen(){var the_div = window.green.style;the_div.visibility="visible";}function hidegreen(){var the_div = window.green.style;the_div.visibility="hidden";}function safe(){var variable = document.f.UPw.value;var alen = document.f.UPw.value.length;if (variable.indexOf(" ")>0){alert ("Mat khau khong duoc co khoang trong");hidered();hideyellow();hidegreen();return false;}if (alen>5){if (!isNumber(variable) || !isChar(variable) || !isSpecial(variable)){window.red.style.backgroundColor="#FF0000";window.document.all['yeu'].color = '#000000';showred();hideyellow();hidegreen();}if (!isNumber(variable) && !isChar(variable)){window.red.style.backgroundColor="#FFCC00";window.document.all['yeu'].color = '#FFCC00';window.yellow.style.backgroundColor="#FFCC00";window.document.all['tb'].color = '#000000';showred();hidegreen();showyellow();}if (!isSpecial(variable) && !isChar(variable)){window.red.style.backgroundColor="#FFCC00";window.document.all['yeu'].color = '#FFCC00';window.yellow.style.backgroundColor="#FFCC00";window.document.all['tb'].color = '#000000';showred();hidegreen();showyellow();}if (!isSpecial(variable) && !isNumber(variable)){window.red.style.backgroundColor="#FFCC00";window.document.all['yeu'].color = '#FFCC00';window.yellow.style.backgroundColor="#FFCC00";window.document.all['tb'].color = '#000000';showred();hidegreen();showyellow();}if (!isNumber(variable) && !isChar(variable) && !isSpecial(variable)){showyellow();showgreen();window.yellow.style.backgroundColor="#009933";window.red.style.backgroundColor="#009933";window.document.all['yeu'].color = '#009933';window.document.all['tb'].color = '#009933';showred();}if (variable==""){hidered();hideyellow();hidegreen();}if (variable.indexOf(" ")>0){alert ("Mat khau khong duoc co khoang trong");variable=="";return false;}}else{hidered();hideyellow();hidegreen();}}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form name=f><table width=400px><TR>                                <TD noWrap>Password:</TD>                                <TD width="100%"><INPUT onkeyup=safe()                                 style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; FONT-FAMILY: Verdana"                                 type=password name=UPw> <FONT                                 color=#ff3300><I>Minimum: 6 characters</I></FONT></TD></TR><TR> <TD noWrap>Re-type</TD> <TD width="100%"> <INPUT onkeyup=safe() style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; FONT-FAMILY: Verdana" type=password name=UPwRetype> <FONT color=#ff3300><I>Minimum: 6 characters</I></FONT></TD></TR>                                <TR>                                <TD align=right width=118>Safe</TD>                                <TD>                                <TABLE id=table23                                 style="BORDER-COLLAPSE: collapse"                                 borderColor=#c0c0c0 cellSpacing=1 cellPadding=0                                 width=210 bgColor=#ffffff border=0>                                <TBODY>                                <TR>                                <TD width=70 bgColor=#e6e6e6>                                <DIV id=red                                 style="BORDER-RIGHT: #a4a6a9 0px solid; BORDER-TOP: #a4a6a9 0px solid; VISIBILITY: hidden; OVERFLOW: hidden; BORDER-LEFT: #a4a6a9 0px solid; WIDTH: 70px; BORDER-BOTTOM: #a4a6a9 0px solid; POSITION: relative; HEIGHT: 16px; BACKGROUND-COLOR: #ff0000"                                 align=center><FONT id=yeu style="FONT-SIZE: 8pt"                                 face=Arial><B>Bad</B></FONT> </DIV></TD>                                <TD width=70 bgColor=#e6e6e6>                                <DIV id=yellow                                 style="BORDER-RIGHT: #a4a6a9 0px solid; BORDER-TOP: #a4a6a9 0px solid; VISIBILITY: hidden; OVERFLOW: hidden; BORDER-LEFT: #a4a6a9 0px solid; WIDTH: 70px; BORDER-BOTTOM: #a4a6a9 0px solid; POSITION: relative; HEIGHT: 16px; BACKGROUND-COLOR: #ffcc00"                                 align=center><FONT id=tb style="FONT-SIZE: 8pt"                                 face=Arial><B>Normal</B></FONT> </DIV></TD>                                <TD width=70 bgColor=#e6e6e6>                                <DIV id=green                                 style="BORDER-RIGHT: #a4a6a9 0px solid; BORDER-TOP: #a4a6a9 0px solid; VISIBILITY: hidden; OVERFLOW: hidden; BORDER-LEFT: #a4a6a9 0px solid; WIDTH: 70px; BORDER-BOTTOM: #a4a6a9 0px solid; POSITION: relative; HEIGHT: 16px; BACKGROUND-COLOR: #009933"                                 align=center><FONT id=tot style="FONT-SIZE: 8pt"                                 face=Arial><B>Good</B></FONT>                                 </DIV></TD></TR></TBODY></TABLE></TD></TR><table></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->