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

Inside Password Field How to show Error Text

1 Answer 99 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Maha asked on 27 Aug 2012, 02:16 PM
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

<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,

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 30 Aug 2012, 11:21 AM
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.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question