Dynamic Dashes displayed for credit cards, phone numbers, etc.
Let's say I have a number or text field. I want to type in perhaps a phone number or a credit card number, but I want it to display dashes in a specific spot.
For example, let's say I have a credit card number 1111222233334444. When I add it in that field, how can I make it so that it simply displays as 1111-2222-3333-4444 (adding a dash after every 4 numbers, if another number exists after it).
Or for example, if I typed in a phone number 9995559999 it would show 999-555-9999. Remember, I am not typing these dashes, I want them pre-set for the field, and to automatically appear.
But if I want to retrieve the numbers from the field, I want it to retrieve the numbers only, not the dashes.
Is this possible? Any help would be MUCH appreciated!