Support Forum
Hello,
I would like to request that Meta Box create a custom field type for phone numbers.
I know that this can be done with the text field and some custom validation, but I think it would be nice to have a very clean solution that is premade for people like the email field already is.
Additionally, it would be fantastic to have the option for the field to have a drop-down country selector that will auto fill the country code and change the validation format to match that country's phone number standards. Many contact form plugins have this feature, and I think it would be really powerful for this community.
Thanks!
Hi,
Thanks for your feedback.
HTML5 also supports field type tel
aka phone number. You can use it as a custom field type. Please read more here https://docs.metabox.io/html5-input-types/
Hi Long,
I had forgotten that MB can do that, so thanks for pointing it out! However, what I think would be nice is a solution that is a bit more complete.
Because phone numbers around the world have different formatting systems, it would be really nice to have a field that is more flexible. That is why I propose a field that has a built-in drop-down for selecting the proper country code. Once the user has selected the code for their country, the form could automatically use the proper format validation for that country’s phone number format.
Is this something that could be done?
Hi,
Thanks for your feedback.
I will inform the development team to consider improving the field tel
to support this case.
Yes. Formatted phone field with dropdown is something I need so much right now. Fluent forms has it and it works perfectly, but I need it from Metabox team
Hi,
Sorry to jump in on this thread. But I could not locate the "tel" field in the dropdown - https://imgur.com/a/69MpkwC
How to get the phone format using HTML5 field?
Kind regards,
Hi Unakriti,
You can just create a text
field and add the custom attribute pattern
to validate the input number as a phone field. Please read more on the documentation
https://docs.metabox.io/custom-attributes/
https://www.w3schools.com/tags/att_input_type_tel.asp
https://stackoverflow.com/questions/19611599/html5-phone-number-validation-with-pattern