将asp文本框模式更改为密码 [英] Change asp textbox mode to password

查看:112
本文介绍了将asp文本框模式更改为密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何使用JavaScript将文本框模式更改为密码。



在此先感谢。

Hi,

How to change the Text-box mode to password using JavaScript.

Thanks in Advance.

推荐答案

请参阅以下链接



使用javascript将文本框的类型从文本更改为密码 [ ^ ]
Refer below link

Changing type of a textbox from text to password using javascript[^]


您好,



您可以使用以下内容:



Hi,

You can use like the following:

<asp:TextBox ID="txtPassword" runat="server" Width="200px" onblur="ChangeMode()"  ></asp:TextBox>







ChangeMode()
{
   document.getElementById("txtPassword").attr('TextMode', 'Password');
}





谢谢



Thanks


试试这行代码..

Try with this line of code..
textbox1.Attributes.Add("onblur", "this.type=''password'';");

这篇关于将asp文本框模式更改为密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆