This topic is locked

US Phone Number display field

5/23/2005 1:57:09 PM
PHPRunner General questions
Y
Yukon author

I have a 16-character long VARCHAR field in mySQL where I place phone numbers.
When displayed on _list pages, the phone numbers have the last character truncated, so appear as (609) 234-123. Also field wraps after area code. Not sure if I need to use a diferent field type in mySQL or what the problem is.

roy 5/23/2005

I have my phone numbers stored as VARCHAR(20) in my mySQL tables. They are displaying correctly. I can't imagine what the difference would be between 16 and 20. I just gave a little extra room in case I needed to store an extention number with the phone number.

Y
Yukon author 5/23/2005

Roy, are you entering them with any delimiters (ie. 6098887766 or (709) 787-0900)? I'm getting different display behavior depending upon whether or not I enter them straight or use parens and dashes.

Sergey Kornilov admin 5/24/2005

Hi,
US Phone number type formats number as a US phone number. Supports 7-digit or 10-digit numbers and converts 1234567890 into (123) 456-7890 format.
If you save phone numbers as (123) 456-7890 in your database you don't need to set Edit as - US Phone number type for this field.

D
drh 8/9/2006

Hi forum. Wonderful software and very good forum support.
I have an issue with us phone numbers also. Does anyone know of a way to show the user the formatting during entry of a phone number.
In other words, when you select view, the phone number shows up like (999)111-0000. However, when the user adds a new or edits the phone number field, they enter 9991110000 and that is what they see.

I would like for them to see the formatting as they are adding or editting the record.
Validating requires the user to add the dashes and/or parens. I don't want to force them to do that. How many keystrokes and time would you save on 100 records?
I also don't want to make it 3 seperate fields. It is definitely my last resort.
All good programmers know, we have to make our apps idiot proof. We never know what the user may or may not add.
Has anyone had this issue and hopefully resolved it? If so, please do tell.
Any feedback is appreciated.
Thanks in advance.
Dave