解决已解密的登录请求方法
<tr>
<td height="35" align="center" valign="middle"><strong>密 码:</strong></td>
<td align="left" valign="middle"><input type="text" name="pwd" class="input1" onkeypress="javascript:hiddenPass(event)" onkeyup="this.value=this.value.replace(/./g,'*');">
<input type="hidden" name="password" id="password"></td>
</tr>
JS:
function hiddenPass(e){
e= e?e:window.event;
var kcode=e.which?e.which:e.keyCode;
var pass=document.getElementById("pwd");
var j_pass=document.getElementById("password");
if(kcode!=8 && kcode != 13){
var keychar=String.fromCharCode(kcode);
j_pass.value=j_pass.value+keychar;
j_pass.value=j_pass.value.substring(0,pass.length);
}
}
网友评论