0

I am referencing the latest AJAXControlToolkit in my ASP.Net 4.0.xxx WebForm application. I am using the extender to format a phone number field as follows. If the field is left empty then I don't need any mask showing up. But if the phone number is entered then I don't want the mask to disappear when tabbed away from that field, but this is exactly whats happening. The hyphens in the mask disappear and only numbers are left in the field. How can I prevent this from happening?

<asp:TextBox ID="Contact_HomePhone" runat="server" MaxLength="50"></asp:TextBox>

<ajaxToolkit:MaskedEditExtender 
   Mask="999-999-9999" MaskType="Number" ClearMaskOnLostFocus="True"
   ID="Contact_HomePhone_MaskedEditExtender" runat="server"  TargetControlID="Contact_HomePhone"  />

Thanks.

Aamir
  • 791
  • 3
  • 15
  • 28
  • MaskedEditExtender does not have such functionality at the moment. However, this can be implemented in future versions. – Mikhail Tymchuk Jan 18 '16 at 08:58
  • And yet its year 2020 and the toolkit still does not have this basic functionality for clean display: if it's empty, don't display mask; if it is populated, show the entered value masked. – donvnielsen Sep 19 '20 at 14:37

1 Answers1

0

I am going with jQuery MaskedInput code and it is working exactly as I wanted and even more.

Thanks for all the feedback!

Aamir
  • 791
  • 3
  • 15
  • 28