This is a migrated thread and some comments may be shown as answers.

Set TextMode of RadTextBox through Javascript

5 Answers 277 Views
Input
This is a migrated thread and some comments may be shown as answers.
Kapil Lavangade
Top achievements
Rank 1
Kapil Lavangade asked on 02 Dec 2009, 01:52 PM
Hello All,
              I want to set textmode of RadTextBox to 'Password' through JavaScript ,I can successfully do it on server side ,but on client side ,I fail to do the same.Please help me out for this. 

Thanks,
Kapil Lavangade.

5 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 02 Dec 2009, 02:27 PM
Hello Kapil,

Such a functionality is not supported by RadTextBox (or asp:TextBox), because it requires switching the "type" property of the textbox element and browsers do not allow this. Use an AJAX request to swtich the TextMode server-side.

All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Erik
Top achievements
Rank 2
answered on 09 Apr 2013, 07:16 PM
Hi all,

Found a working solution.

This example show the password on focus, but you can use it in other ways to of course (via a checkbox "show password" ie)

<telerik:RadTextbox ID="rnt_User_Password" TextMode="Password" runat="server" />

txt_User_Password.Attributes.Add("onfocus", "this.type='text';")
txt_User_Password.Attributes.Add("onblur", "this.type='password';")

Erik
0
Vasil
Telerik team
answered on 10 Apr 2013, 12:38 PM
Hello Erik,

This will work in most browsers, but not in older IE like 6 and 7. So use it if you are sure that your site is browsed in modern browsers.

Greetings,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Erik
Top achievements
Rank 2
answered on 10 Apr 2013, 01:16 PM
ok, thanks Vasil. (I'm done with IE<=7 :-) )
0
t
Top achievements
Rank 1
answered on 11 Jul 2014, 02:21 PM
Thanks Erik
Tags
Input
Asked by
Kapil Lavangade
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Erik
Top achievements
Rank 2
Vasil
Telerik team
t
Top achievements
Rank 1
Share this question
or