Creating Custom Field - Telephone

Support General Creating Custom Field - TelephoneResolved

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #12252
    @mindspark@mindspark
    Participant

    Hi Anh - I've read the KB on this, but what I don't see in the instructions is:

    1. can you convert a standard text field to a TEL field by using an Attribute?
    2. what would be the complete string to add into the functions.php file to create the new field type as an option in the meta-builder?

    thanks

    #12285
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    1. Yes, it's possible. Please just change the type from text to tel and you already have telephone field. It's actually a HTML5 input type and I already covered it here.

    2. The MB Builder could not be extended that way. If you create a new field type, it's available for coding only. It won't show in the Builder.

    #12296
    @mindspark@mindspark
    Participant

    Thx Anh -

    I don't know WHERE to change the field type from Text to TEL....? there isn't an option in the builder itself that I can find

    #12314
    Anh TranAnh Tran
    Keymaster

    Ah, you're using the MB Builder :). I was saying about using code.

    In MB Builder, to change the type, please go to Advanced tab, try add a custom attribute type with value tel.

    #12328
    @mindspark@mindspark
    Participant

    so sorry about this....

    which field type do I select? there is no option for HTML5 or anything related to text?

    see here: https://snag.gy/CX69fH.jpg

    #12330
    @mindspark@mindspark
    Participant

    please disregard my last note.

    Using a TEXT field, I went to Advanced tab and in Attributes I added TYPE and TEL.

    after updating, the field still allows me to enter text and numbers are not formatted as a telephone number.

    see here:

    setting attribute - https://snag.gy/61TK29.jpg
    number not formatted as phone number - https://snag.gy/gG3d2n.jpg
    field accepts text vs numbers - https://snag.gy/mcPKxk.jpg

    #12357
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    The tel input still allows to enter text. In order to force a format, please add another custom attribute with name pattern and value like [0-9]{3}-[0-9]{3}-[0-9]{4} (123-456-7890). Then the plugin will use that pattern as a validator for data entered.

    Please note that the value is a regular expression, where [0-9] means only numbers, {3} means only 3 times. For more info, please read this guide.

    #12361
    @mindspark@mindspark
    Participant

    Hi Anh - I found the patterns detail on my own yesterday... I was assuming that the pattern allows for real-time field validation. unfortunately the pattern method only validates on submission. 🙁

    as always thanks for your efforts here!

    #17589
    tech500tech500
    Participant

    Hi,

    I'm using the MB Builder for a phone number field, and the number doesn't get formated to a phone number format like the custom attribute mentioned.
    Tried both text & number field types, and also added the "tel" type attribute.

    How can I get a phone number format properly?

    Thanks
    Dan

    #36746
    shawn@series5technology.com[email protected]
    Participant

    I have a text box that I need to be clickable to call for a phone number. I've tried everything. Should be pretty simple. I have a setting page with client numbers and have selected the number in elementor. I prepended the text with tel: however, it is not calling instead it's going to a broken link. URL doesn't work either.

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