Phone, SSN, and other formats

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
vinsnash
Posts: 415
Joined: Sun Oct 07, 2007 4:58 pm

Phone, SSN, and other formats

Post by vinsnash »

I saw some discussion of this on old posts. Is it possible now to force numeric editing for phones, and other numbers?

Example:


Phone: (999) 999-9999
SSN: 999-99-9999

I'm looking for a way to allow the user to enter the digits and the system to group and supply the dashes and parens.

All help appreciated.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

vinsnash,

I'm not sure of your exact requirements, but an easy way would be to have 2 attributes:

1a- PhoneInput - text 10
1b- Phone - text 13

You can then make a rule:
Customer.Phone='('+SUBSTRING(Customer.PhoneInput,0,3)+')'+SUBSTRING(Customer.PhoneInput,3,6)+'-'+SUBSTRING(Customer.PhoneInput,6,10)

Hope this helps.
Tom
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

A user may enter their own dashes and spaces, therefore I would add an intermediate attribute where you store a phone number cleaned up of user's non-numerical input

1aa - PhoneInputShort

and a rule

PhoneInputShort=REPLACE_PATTERN(PhoneInput,'[ .-]','')

Then use this PhoneInputShort in further formatting
vinsnash
Posts: 415
Joined: Sun Oct 07, 2007 4:58 pm

Phone, SSN etc.

Post by vinsnash »

A little late getting back. But thanks all that's very helpful.
Post Reply