Click here to Skip to main content
Sign Up to vote bad
good
See more: C#Javascript
Hi,
 
How to change the Text-box mode to password using JavaScript.
 
Thanks in Advance.
Posted 25 Jan '13 - 2:34


3 solutions

  Permalink  
Comments
Abhishek Pant - 25 Jan '13 - 9:12
+5
Marcus Kramer - 25 Jan '13 - 10:04
+5. Good link
AshishChaudha - 27 Jan '13 - 23:54
my 5+
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
  Permalink  
Try with this line of code..
textbox1.Attributes.Add("onblur", "this.type='password';");
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Mohammed Hameed 268
1 OriginalGriff 261
2 Mayur_Panchal 153
3 Sergey Alexandrovich Kryukov 148
4 CPallini 96
0 Sergey Alexandrovich Kryukov 8,171
1 OriginalGriff 6,246
2 CPallini 3,532
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid