Re: How to deal with phone numbers
Re: How to deal with phone numbers
- Subject: Re: How to deal with phone numbers
- From: Stirling Olson <email@hidden>
- Date: Wed, 16 Mar 2005 09:30:38 -0700
Yeah, I'd suggest option 3 perhaps with some piece of option 2. In
addition to the country-code issue, there are often cases where you'd
want to allow users to add extensions (e.g. "123-456-7890 x42") or some
additional text (e.g. "123-456-7890 2nd tier customer support"). So if
you want all phone numbers to be checked and you are dealing with only
US/Canada numbers then you could match a regex pattern like
[0-9]{3}-[0-9]{3}-[0-9]{3} [.]* so you'd allow US-style numbers with
any trailing text. If you are not dealing with just US numbers then
you could get fancy and have a separate field for country code and have
a separate regex pattern for each country-code with the default being
to allow anything so you wouldn't have to research each and every
country's phone patterns.
-Stirling
On Mar 16, 2005, at 8:59 AM, Albert Jagnow wrote:
I have always just let users enter the numbers in whatever format they
want. The biggest issue for us is that not all of our users are in
the United States so we have to be able to accept international phone
numbers. When I show the users what they entered I just give it back
to them in the exact format they entered. For internal use if I want
to create a standard format I just reformat the number when needed.
--Albert
On Mar 16, 2005, at 9:13 AM, Jeremy Matthews wrote:
Ok,
The three scenarios I can imagine when dealing with phone/fax
numbers...
1) Create fields for each set of digits (e.g., field for area code,
for the second set of digits, and another for the third) and limit
input by number of characters in those entry fields within the form
2) Create a single, long text field that performs a check prior to the
EC saving to the DB, and warn the user to reformat in a specific
pattern (i.e., xxx-xxx-xxxx)
3) Create a text field and do not attempt to restrict/control, and
reformat during the DB save
Any experience here? Pros or cons?
Thanks,
Jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden