By userofdrupal on
I want to add a phone number to my CCK content type, so naturally, I downloaded the Phone (CCK) module. However, this seems to always format the number with a leading one (in the United States) which I don't want. E.g.:
1 555-123-4567
I would prefer the number to be formatted like so:
(555) 123-4567
Should I not use the Phone module and use something else instead (a text field perhaps?)? How can I do this?
Comments
You could use CCK computed
You could use CCK computed field if you know a little bit of PHP and regular expressions. ;)
Is using a computed field
Is using a computed field how most people do it? How do you do it? In this case I'm the one entering the phone numbers so should I just use a text field?
I don't need a phone number
I don't need a phone number input...
I just thought using CCK Computed Field could allow you to parse the users' input using some PHP code...
The value is not really computed in this case.
open phone.ca.inc in your
open phone.ca.inc in your phone module...
at the end of the page you will see the following code
replace it by this
______________________________
next project convert this site to drupal -> http://www.oghnia.com
Thanks, I appreciate it.
Thanks, I appreciate it. I'll look into it.