New field type request (phone number)

Support General New field type request (phone number)Resolved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #35861
    GracesonGraceson
    Participant

    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!

    #35867
    Long NguyenLong Nguyen
    Moderator

    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/

    #35876
    GracesonGraceson
    Participant

    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?

    #35892
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thanks for your feedback.

    I will inform the development team to consider improving the field tel to support this case.

    #37337
    Wojtek PiskorzWojtek Piskorz
    Participant

    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

    #38075
    UnakritiUnakriti
    Participant

    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,

    #38105
    Long NguyenLong Nguyen
    Moderator

    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

    #43011
    sandrinerodriguessandrinerodrigues
    Participant

    Hello Long,

    I am jumping on this thread too...

    Did the type "tel" disappeared from the Metabox Builder ? I can't find it under HTML5.

    And I can't see any pattern option in the text field ?

    Did anything change in the new version of Metabox AIO ?

    Thank you,
    Sandrine

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.