Inside Password Field How to show Error Text

2 posts, 0 answers
  1. Maha
    Maha avatar
    3 posts
    Member since:
    Aug 2012

    Posted 27 Aug 2012 Link to this post

    Dear Sir/Madam

    Problem 1 : Inside Password Field How to show Error Text
    I have TextBox which accept Password as Input 
    I want to validate 
    1)Must be Required Field
    2)Minimum Password Characters is 6.If user enters password less than 6.
    I want to show Error Message Inside Password Textbox(Min.6 Chracters like that)

    How to do above using RadInputManager?

    I  set  Empty Message and ErrorMessage for Password Textbox.But it is doesn't works

    Becoz Having TextMode=Password show Required Text in the form of Bullets

    I want to show Error Message inside TextBox with effects similar to RadNumeric Text

    My ASPX
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
        <asp:TextBox ID="txtpwd" runat="server" TextMode="Password" Width="150px" Height="20px"></asp:TextBox>
           <telerik:RadInputManager ID="RadInputManager1" runat="server">
         <telerik:TextBoxSetting BehaviorID="PasswordBehavior" EmptyMessage="Password" ErrorMessage="Required"  Validation-IsRequired="true" >
        <TargetControls><telerik:TargetInput ControlID="txtpwd" /></TargetControls>
         <PasswordStrengthSettings ShowIndicator="true"  RequiresUpperAndLowerCaseCharacters="False" PreferredPasswordLength="6" MinimumUpperCaseCharacters="0" MinimumSymbolCharacters="0" MinimumNumericCharacters="0" MinimumLowerCaseCharacters="0" />


    With Regards,
  2. Kostadin
    Kostadin avatar
    1690 posts

    Posted 30 Aug 2012 Link to this post

    Hello Maha,

    I already answered your support ticket but I will write my reply here, too, for others who have the same requirement.

    When the TextMode property of an ASP.NET TextBox is set to Password the value in the field is displayed as bullets. It is actually by design to prevent the unmasked password from being displayed in the HTML source of the page. The workaround is to have a separate label positioned over the TextBox. It can be hidden and shown depending on same criteria and use it as an error message as in your case. I prepared a sample where I used the Label as an empty message of the TextBox and attached it to this message.

    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. DevCraft R3 2016 release webinar banner
Back to Top