日期:2014-05-18  浏览次数:20476 次

怎么用input type = password控件来检验输入的密码是否正确?
在asp.net中 <input   id= "key "   type   =   "password "   > 创建了一个密码输入框,怎么判断这个输入的密码是否与给定的字符串比如 "hello "是一样的呢?

------解决方案--------------------
做个判断就可以了;
if(key.value.TosString()== "hello ")
{
response.wirte( "验证成功 ")
}
else
{
response.wirte( "验证失败 ")
}
------解决方案--------------------
实在不知道该怎么解释

js
if(document.getElementById( 'key ').value == "hello ")
alert( '一样! ');

c#
楼上给了