I want to add 3 text boxes for a phone number field. The phone number format should be xxx xxx xxxx.

I need to show 3 text boxes and stored values into single field.

How can I do this?

  • Where you wanna add those fields? Node edit form? Custom form? Where you wanna have them displayed how? – leymannx Nov 5 '15 at 23:14

You can use Masked Input to format a field. It won't give you three text boxes. But it can solve your problem by formatting the text box like below,

masked input formatting

| improve this answer | |

Instead of creating the three different fields, create only one field of type phone by installing any of the below module.

  1. Phone
  2. Phone Number (CCK)
  3. Telephone
| improve this answer | |
  • Yes i know. But as per my requirement, i need to show 3 text boxes – Guru Nov 3 '15 at 10:41
  • can you please tell me any specific reason behind creating 3 text boxes? I think you should create one field and using jQuery format the display. – Nikhil Banait Nov 3 '15 at 10:44
  • @Guru - simply go for one Telephone field and it's cardinality set to three. – leymannx Nov 3 '15 at 23:29

Have a look at the Field Group module, to create a group of 3 'fields' (1 for each of your 3 textboxes).

Excerpt from its project page:

Fieldgroup will group fields together. All fieldable entities will have the possibility to add groups to wrap their fields together. Fieldgroup comes with default HTML wrappers like vertical tabs, horizontal tabs, accordions, fieldsets or div wrappers.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.