RadTextBox, TextMode=Password and EmptyText

10 posts, 0 answers
  1. Alexander Shashkin
    Alexander Shashkin avatar
    15 posts
    Member since:
    May 2010

    Posted 27 Jun 2012 Link to this post

    Hi all,

    I found that EmptyText doesn't work properly for RadTextBox if it has TextMode=Password.
    I use v.2012.2.607.35
    Also, I noticed that it doesn't work even on demo page:
    http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx 

  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 28 Jun 2012 Link to this post

    Hi Alexander,

    Check this out:
    Changes in RadInput in Q2 2012 version of RadControls

    And this 2 workarounds:
    Set EmptyMessage for TextBox in Password Mode
    How to Use an EmptyMessage with Password RadTextBoxes


    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alexander Shashkin
    Alexander Shashkin avatar
    15 posts
    Member since:
    May 2010

    Posted 28 Jun 2012 Link to this post

    Hi Vasil,

    Thank you for your answer!

    But these 2 workarounds don't work for me because I don't understand why I need to use RadTextBox and implement this logic myself? In this case it is better to use asp text box or something else, because I at least will not need to download styles/scripts. 

    About first link: I understand what you try to do, but I don't understand why you released new version and didn't checked that old features will work. I still think that this issue is a bug and it should be fixed.
    If you don't plan to fix it then I think that it will be better if code of example will be edited and so on.
    Notice that this issue not only about EmptyMessage/placeholder, but also there is some bug in JS: just click on input and then click on form. You will see that input will have some text.
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 28 Jun 2012 Link to this post

    Hello,

    In short because the new version is way faster and lighter than the old one, and empty message in password моде is used too rarely to make the whole control heavier because of this, and even there are 2 possible workarounds. Of course you could use asp:TextBox, and you will have to do similar client logic.  Yes it is considered as limitation since it was never working before Q1 2012, and there is PITS issue about it. We just think that the whole control (numeric text box, masked text box and date input) should not suffer of performance penalty to work in this insulated case that is applied for the TextBox only.

    About the demo: the idea of the demos is to show the exact plain functionality, so the people to know how the controls behaves and what to expect. All custom solutions are posted in the CodeLibrary section. Focus/blur causes the empty message to be shown, and it is a bug that it is not shown from the beginning and we have fixed this, but the demos are using the official version and not hotfixes so they will stay such way until the Service Pack.

    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. Eder
    Eder avatar
    1 posts
    Member since:
    Feb 2013

    Posted 28 Jun 2013 Link to this post

    Hi, I have found a solution for this problem.

    In the ASPX file:

    <ajaxToolkit:TextBoxWatermarkExtender ID="WatermarkPassword" runat="server" TargetControlID="TB_Password" WatermarkText="No password" WatermarkCssClass="textInput" />
    <asp:TextBox ID="TB_Password" runat="server" TextMode="Password" CssClass="textInput" MaxLength="20"></asp:TextBox>

    In the CS file when in some case don't want to show this watermark:

    WatermarkPassword.Enabled = false;
  7. Duy
    Duy  avatar
    68 posts
    Member since:
    Apr 2009

    Posted 31 Mar 2014 in reply to Vasil Link to this post

    Hi,

    I got version 2013.1.403.40, but still can not show the empty message for password mode.  Just want masked letters in the radtextbox to indicate that is a password field to enter.

    Kind Regards,

    Duy
  8. ghini
    ghini avatar
    25 posts
    Member since:
    Sep 2012

    Posted 20 Jul 2014 in reply to Duy Link to this post

    the bug is still present in version 2014.1.403.45....
  9. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Jul 2014 in reply to ghini Link to this post

    Hi ghini,

    It is not possible to set any Text (including EmptyMessage) in a password input mode, this is a browser restriction. The input type should be set to text to be able to display some text in the input (which is achieved inRadTextBox by setting the TextMode as "SingleLine" or "MultiLine" and not to "Password"). The "password" type causes the browser to display any text one sets in the well known password mode. Please try to to use the any of the work around that mentioned in the above posts. 

    Thanks,
    Princy.

  10. Joe Hakooz
    Joe Hakooz avatar
    65 posts
    Member since:
    Dec 2007

    Posted 27 Mar 2015 Link to this post

    Here is a simpler approach to this.

    I noticed that if you focus then blur a password textbox, the empty message appears. Tested in Chrome and IE9+
    Simply use javascript to instantly focus/blur the textbox once it loads and you're good to go...

    <script type="text/javascript">
        function Load(sender, args) {
            pw = sender;
            pw.focus();
            pw.blur();
        }
    </script>
    <telerik:RadTextBox runat="server" ID="Password" EmptyMessage="********" TextMode="Password">
        <ClientEvents OnLoad="Load" />
    </telerik:RadTextBox>

    Hope that helps!
  11. Joe Hakooz
    Joe Hakooz avatar
    65 posts
    Member since:
    Dec 2007

    Posted 27 Mar 2015 in reply to Joe Hakooz Link to this post

    Important note... this only works if the text is stars: **************
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017