Hello,
I am using the RadMaskedTextBox to display a mask for a Social Security Number field, but I would like to display the mask only when the textbox has the focus. When the textbox has the focus the mask should be displayed, such as ___-__-____. If the user enters a number of values, the mask should still be displayed along with the values entered such as 415-74-____. If the user does not enter any values or deletes these values, the mask should not be displayed. Is this possible using the RadMaskedTextBox?
This brings a couple of issues to mind:
1. When the mask is constantly displayed in a field that is not required or doesn't need to be validated, the RadMaskedTextBox will send the mask characters to the database field. The developer then needs to code for the mask as in:
I am using the RadMaskedTextBox to display a mask for a Social Security Number field, but I would like to display the mask only when the textbox has the focus. When the textbox has the focus the mask should be displayed, such as ___-__-____. If the user enters a number of values, the mask should still be displayed along with the values entered such as 415-74-____. If the user does not enter any values or deletes these values, the mask should not be displayed. Is this possible using the RadMaskedTextBox?
This brings a couple of issues to mind:
1. When the mask is constantly displayed in a field that is not required or doesn't need to be validated, the RadMaskedTextBox will send the mask characters to the database field. The developer then needs to code for the mask as in:
if
(SSN == "___-__-____")
SSN = string.Empty;
I don't feel as though this is proper. Is there a way around this? Can the mask be displayed only when values exists?