Set TextMode of RadTextBox through Javascript

6 posts, 0 answers
  1. Kapil Lavangade
    Kapil Lavangade avatar
    4 posts
    Member since:
    Aug 2009

    Posted 02 Dec 2009 Link to this post

    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.
  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 02 Dec 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 09 Apr 2013 Link to this post

    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
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 10 Apr 2013 Link to this post

    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.
  6. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 10 Apr 2013 Link to this post

    ok, thanks Vasil. (I'm done with IE<=7 :-) )
  7. t
    t avatar
    1 posts
    Member since:
    Jul 2014

    Posted 11 Jul 2014 Link to this post

    Thanks Erik
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017