<%@ Page Language=
C#
AutoEventWireup=
true
CodeBehind=
Default
aspx
cs
Inherits=
PasswordStrong
_Default
%>
<!DOCTYPE html PUBLIC
//W
C//DTD XHTML
Transitional//EN
http://www
w
org/TR/xhtml
/DTD/xhtml
transitional
dtd
>
<html xmlns=
http://www
w
org/
/xhtml
>
<head runat=
server
>
<title></title>
</head>
<body>
<form id=
form
runat=
server
>
<div>
<input id=
reg_passwd__
name=
reg_passwd__
value=
;=
onkeyup=
update_strength(
reg_passwd__
reg_passwd__strength_display__
)
autocomplete=
off
type=
password
/>
<script type=
text/javascript
>
function update_strength(input_field_id
output_display_id)
{
var input_field = document
getElementById(input_field_id);
var output_display = document
getElementById(output_display_id);
var input_str = input_field
value;
var input_length = input_str
length;
var strength =
;
// increase strength if contains [
]
number_re = new RegExp(
[
]
);
if (number_re
test(input_str)) {
strength++;
}
[] []
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20664.html