Click here to Skip to main content
12,954,601 members (56,051 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi,

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

Thanks in Advance.
Posted 25-Jan-13 2:34am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Abhishek Pant 25-Jan-13 9:12am
   
+5
Marcus Kramer 25-Jan-13 10:04am
   
+5. Good link
AshishChaudha 27-Jan-13 23:54pm
   
my 5+
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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
Top Experts
Last 24hrsThis month
OriginalGriff 6,539
CHill60 3,490
Maciej Los 3,143
ppolymorphe 2,030
Jochen Arndt 1,975


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100