Masking the phone and social security number entries with dashes
Posted on 2004-08-05
Right now the text box controls on my program will only restrict the users to 12 characters for the telephone field and 11 characters for the social security number. However some of my users are not using dashes to separate the numbers properly and this is causing problems in reports since they are harder to read. How can I let my users enter just the numbers and do the masking programmatically behind the scenes and then display their output in the textbox with the dashes in the proper positions?
My second question is related to the first one: Some users have in the past used dots (.) to separate and mask these numbers - how can I parse through these numbers as they are retrieved and replace the dots with the proper dashes?