0. 密码为空
1. 密码长度小于六位.或者密码只有一种组合
2.密码长度大于五位, 且有两种组合.
3. 密码长度大于五位, 且有三种组合.
4. 密码长度大于五位, 且有四种组合.
四种组合指数字,小写字母,大写字母,其它字符
<script type="text/javascript" language="javascript">
function EvaluatePassword()
{
var word = document.getElementById("TextBox1").value;
var type = word.match(/[a-z](?![^a-z]*[a-z])|[A-Z](?![^A-Z]*[A-Z])|/d(?![^/d]*/d)|[^a-zA-Z/d](?![a-zA-Z/d]*[^a-zA-Z/d])/g).length;
if(word =="")
{
alert("不能为空");
}
else if(word.length<6)
{
alert("长度不要小于6");
}
else if(type == "1")
{
alert("密码应该混合");
}
else
{
alert("符合条件");
}
}
</script>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:Button ID="Button1"
runat="server" Text="Button" OnClientClick="EvaluatePassword()" />
</div>
</form>