Phone

Summary

The Phone field allows users to enter a phone number. The field will automatically format the entered data based on the selected phone format in the General settings (see note below). It is available under the Advanced Fields section within the form editor.

Phone field as displayed in the Field Library

Phone field as displayed in the Field Library

Phone field as displayed in the Form Editor.
Phone field as displayed in the Form Editor.

Common Settings

This field uses only common field settings for the Appearance and Advanced settings. For a description of each of the common field settings, refer to this article. Below you will find description of specialty settings that are particular to this field.

General Settings

Image showing Phone Field Settings
SettingDescription
Phone FormatSelect the format you would like to use for the phone input. The International (formatted) format lets users pick their country and formats the phone number accordingly.
Available options are:
– International (Formatted)
– International (Unformatted)
– US Standard
Default CountrySelect the default country that will be pre-selected when the phone field is displayed. If no country is selected, United States will be used as the default.
This setting is only applicable for International (Formatted)
Show country dial codeWhen enabled, the country dial code (e.g. +1, +44) will be displayed beside the country flag. Users can also type the dial code directly to select a country.
This setting is only applicable for International (Formatted)
Sub-LabelsEnter values in this setting to override the Sub-Label for each field.

Merge Tags

For more information on the use of merge tags, refer to these articles.

Usage

Merge TagDescription
{Phone:2}Display the Phone Number. E.g.: (205) 828-2001
{Phone:1:country} Display the Country Code E.g.: US
{Phone:1:e164}Display the Phone Number formatted. E.g.: +12058282001

Notes:

  • The first of these merge tag parameters is optional and serves only as a field name for easier identification.
  • The second parameter defines the field ID within the form. In the example above, the field ID is 2.

Modifiers

This field does not have any modifiers.

Validation

The Phone field validates the submitted value against the regex pattern defined by the field’s configured phone format. Validation only runs when the field has a value. Empty submissions are not checked.

The Standard format expects a 10-digit US phone number and accepts common variations such as (555) 123-4567, 555-123-4567, and 5551234567. When validation fails, an instruction showing the expected format is displayed below the field. The International format has no regex pattern and does not perform any format validation.

Custom phone formats can be defined using the gform_phone_formats filter, which also allows custom regex patterns and instructions to be specified.