What is the best field type to use for a phone number?

owayslate's picture

owayslate
February 29, 2012
8:58am

What is the best field type to use for a phone number?  Is there any way to have parenthesis automatically show up for the area code and a dash in between the numers? (XXX)XXX-XXXX

Also, can I limit the users who will see the phone number to registered or authenticated users?  Is this done on the same page?

I have it set to Field visibility and permissions:  Custom permissions

View anyone's value for field Contact PhoneChecked authenticated user

Is this the correct way to approach it?

I have searched the forum but can't find anything.  Thanks so much!

Status: Resolved

Comments

Moderator
stacywray March 2, 2012
11:55am

Hi owayslate,

The best field to use would be the regular text field.

Under your default value for the field, you can set up the parentheses and dash between the numbers. I would recommend setting the default as shown below so that the user could just go in and replace the placeholder digits with their own:

(XXX) XXX-XXXX or (123) 456-7890

Here are a series of screenshots demonstrating the above as well:

https://skitch.com/e-stacywray/8guq9/create-webform-stacywray-heart-testing (auto phone number)

https://skitch.com/e-stacywray/8gux6/phone-number-field

https://skitch.com/e-stacywray/8gutw/phone-default-value

The permissions you mentioned above are the correct settings. If you choose to display the information in a block, you will also need to restrict visibility of the block to authenticated users.

Hope that helps!

 

Best regards,

 

Stacy Wray | Acquia Senior Support Engineer
 

Moderator
stacywray October 1, 2012
12:20am

Hi owayslate,

I'm closing out this post due to inactivity.

Please feel free to create a new thread if needed.

Thank you!

 

Best regards,

Stacy Wray | Acquia Senior Support Engineer
 

This topic has been closed to further comments.

Feedback