E
Earl
I'm curious if there are others who have a better method of
accepting/parsing phone numbers. I've used a couple of different techniques
that are functional but I can't really say that I'm totally happy with
either.
1. My first technique was to restrict the users to entries that could only
be 3 character, 3 characters, 4 character (area code, prefix, suffix,
respectively). I would null out any inputs that were non-numeric (except the
backspace). This worked reasonably well, except it was somewhat ugly to look
at.
2. My second technique was to give the user a single text entry box and
auto-format the string with hyphens as they entered the phone number. I then
parse the phone number, knowing exactly where the hypens are located.
What I'm looking for is some better ideas. Anyone?
accepting/parsing phone numbers. I've used a couple of different techniques
that are functional but I can't really say that I'm totally happy with
either.
1. My first technique was to restrict the users to entries that could only
be 3 character, 3 characters, 4 character (area code, prefix, suffix,
respectively). I would null out any inputs that were non-numeric (except the
backspace). This worked reasonably well, except it was somewhat ugly to look
at.
2. My second technique was to give the user a single text entry box and
auto-format the string with hyphens as they entered the phone number. I then
parse the phone number, knowing exactly where the hypens are located.
What I'm looking for is some better ideas. Anyone?