关于AJAX Toolkit中的PasswordStrength使用问题

html-css014

关于AJAX Toolkit中的PasswordStrength使用问题,第1张

StrengthIndicatorType表示密码强度的显示样式,分为两种:

当其值设为Text时,表示以字符形式显示,此时需对应设置:TextStrengthDescriptions="很弱弱中强很强"

如果其值设为:BarIndicator时表示图形方式显示,此时需要给其定义图形显示的,CSS样式,否则就会报错过

查看示例:DEMO

打包下载

使用很简单。

复制代码

代码如下:

$('#pass').passwordStrength()

XHTML

复制代码

代码如下:

<p><label>请输入密码:</label>

<input

type="password"

id="pass"

class="input"

/></p>

<div

id="passwordStrengthDiv"

class="is0"></div>

<p><label>确认密码:</label>

<input

type="password"

id="repass"

class="input"

/></p>

注意:id#passwordStrengthDiv的DIV是用来加载强度图片的,你也可以自定义ID,但调用时就要给参数赋值:

复制代码

代码如下:

targetDiv

:

'#ID'

//自定义加载图片的ID

载入JS和CSS:

复制代码

代码如下:

<link

rel="stylesheet"

type="text/css"

href="style/main.css"

/>

<script

type="text/javascript"

src="jquery.js"></script>

<script

type="text/javascript"

src="jquery.passwordStrength.js"></script>

<script

type="text/javascript">

$(function(){

$('#pass').passwordStrength()

})

</script>