我可以得到< input type = text>看起来像< input type = password> ;?
我想处理一个令人沮丧的Internet Explorer问题,阻止我将 jquery-validate 与 jquery-placeholder 。简而言之,验证不适用于 type = password
的字段。
I'm trying to deal with a frustrating Internet Explorer issue that prevents me from using jquery-validate in conjunction with jquery-placeholder. In short, the validation does not work on fields with type=password
.
一个可能的修复我想出了是修改我的密码为 type = text
,但这当然显示的密码以纯文本,而不是 *******
。
One possible fix I came up with is to modify my passwords to be type=text
, but this of course displays the passwords in plain-text rather than as *******
.
有没有聪明的 html
/ js
/ css
技巧使 text
好像他们密码
s
Is there any clever html
/js
/css
trick to make text
fields display as though they were password
s?
有一个模拟密码值的隐藏输入类型
Have a hidden input type that simulates the password values
所以我想jquery聪明的是
So I guess jquery wise it would be
//everytime the password changes hidden changes with it.
$('#passwordId').change(function() {
$('#hiddenID').val() = $('#passwordId').val();
});
html:
<input type="password" id="passwordId" />
<input type="hidden" id="hiddenID" />
因此,这将允许您验证与密码相同的隐藏输入。
So this would allow you to validate the hidden input which would be the same value as the password.