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

Is it possible to hide the mask?

3 Answers 130 Views
Input
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 28 Apr 2011, 03:17 PM
I would like the input to originally appear empty, and only show the mask if the user begins entering a value.  If the user removes the value, the mask will again disappear.

Is this functionality possible with this control?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Apr 2011, 08:13 AM
Hello,

You can achieve this behavior by setting the HideOnBlur  property of the RadMaskedTextBox to "True"
Here is a sample code:

aspx:
<telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server" HideOnBlur="True" Mask="(###) ###-####">
</telerik:RadMaskedTextBox>

Thanks,
Princy.
0
Vincent
Top achievements
Rank 1
answered on 28 Aug 2012, 09:23 PM
This function HideOnblur does not work when I have a RequiredFieldValidator attached to the RadMaskedTextBox. It always display the mask. Is there a work around?
Thanks.
0
Vasil
Telerik team
answered on 29 Aug 2012, 08:19 AM
Hello Vincent,

The Validator itself does not affect the behaviour of RadMaskedTextBox and its HideOnBlur property.

It is possible that you have set SetFocusOnError="true" for your Validator, in this case when you try to blur, the validator gets back the focus to the input element of RadMaskedTextBox, and since the input is in focus, it will again display the mask.
Make sure you have set SetFocusOnError="false" for your Validator to avoid this problem.

Regards,
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.
Tags
Input
Asked by
Karl
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Vincent
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or