Phone Number Fields (Better)

Changing Country In Caldera Forms Phone Field
Caldera Forms Phone Number Better Field All Options
All of the settings for a phone number (better) field. Click to enlarge.

Caldera Forms phone number (better) fields provides an advanced mobile number formatted field for your forms. This field type is useful for event registration forms, booking forms and other types of WordPress forms where you need to ensure you receive a properly formatted phone number in your form.

As opposed to the older phone number fields, these fields provide country specific formatting and validation, and look better.

You can add a phone number (better) field to your form by grabbing the Add Field button and dragging it into the form builder grid. Then in the add field popup click to Select on the left side and then select Phone Number (Better).

These new and improved fields were introduced in Caldera Forms 1.5.

Changing Country In Caldera Forms Phone Field
Your site visitor’s can search by country name.

Special Settings For Phone Number Fields

In addition to standard field settings, phone number (better) field has an additional special option:

  • Country Code – Checking this setting will enable users to select their country’s mobile code.

Customizing Initial Country and Preferred Countries of Caldera Forms Phone Fields

caldera_forms_phone_js_options

Translating Caldera Forms Form Field Validation Messages

The validation messages for phone fields, are translatable using WordPress’ built-in translation system. You do not need a filter or anything else but standard WordPress translation tools.

You can use a plugin such as Loco Translate these strings on your site. Even better, you can contribute translations to Caldera Forms.

List Of Strings

The following are translatable strings used by the Caldera Forms Phone Better Field.

  • Invalid number
  • Invalid country code
  • Not a number
  • Number is too long
  • Number is too short

Developer Notes

These strings are generated in the PHP class Caldera_Forms_Render_JS in the method phone_better. The strings are translated using _(). They are later printed to the DOM, and consumed by the JavaScript Caldera_Forms_Field_Config function.