Phone input

Use phone_input to collect a respondent’s phone number. You can optionally show a country selector and collect an extension.

See shared field properties for properties accepted by every field type.

Configuration

NameTypeRequiredDefaultDescription
placeholderstringNoNoneGrey hint text inside the empty input. Supports {{field}} piping.
defaultValuestringNoNonePrefills the input. May contain a {{hidden_name}} reference.
enableCountryCodebooleanNofalseShows a country selector and stores the dial code with the number.
defaultCountryCodestringNoUS when enableCountryCode is true; otherwise not usedTwo-letter country code, such as US, GB, or DE. Sets the country selected initially.
collectInternationalExtensionbooleanNofalseAdds an extension input next to the number. Used only when enableCountryCode is true.

Validation

When the field is required, an empty answer blocks the respondent from continuing. A dial code by itself counts as empty. If the number has fewer than 4 or more than 15 digits, a message appears under the field.

Submission value

The answer is a string containing the dial code and number, such as +442079460123. When an extension is collected, it is appended as ext <n>, such as +442079460123 ext 45.

Example

{ "type": "phone_input", "name": "mobile", "label": "Mobile number", "placeholder": "Enter your number", "defaultValue": "", "enableCountryCode": true, "defaultCountryCode": "GB", "collectInternationalExtension": true, "required": true }