Number input field
Use number_input to collect a numeric answer, such as a team size or quantity.
Configuration
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | Yes | n/a | Set to number_input to select this field type. |
name | string | Yes | n/a | At least 1 character. Use letters, digits, and underscores, starting with a letter. This is the field’s key in submission data. |
label | string | No | None | Main question text. Supports {{field}} piping. |
subtext | string | No | None | Smaller text under the label. Supports {{field}} piping. |
input_label | string | No | None | Small text above the input. Supports {{field}} piping. |
required | boolean | No | false | Set to true to require an answer before the respondent leaves the page. A required field shows * after its label. |
visible_if | condition array | No | None (always shown) | Show the field only when the condition is true. An empty array hides it. See shared field properties. |
hide_if | condition array | No | None (never hidden) | Hide the field when the condition is true. See shared field properties. |
min | number | No | None (no lower limit) | Any number. Lowest value accepted without a message. |
max | number | No | None (no upper limit) | Any number. Highest value accepted without a message. |
defaultValue | string | No | None | A number written as a string, such as "5". May be "{{hidden_name}}". Prefills the input. |
The defaultValue string is parsed as a number. If it references a hidden field, that field’s value is substituted first. Fields hidden by visible_if or hide_if are not validated.
Validation
If the field is required and empty, the respondent cannot continue. If the answer is not a number, a message appears under the field and nothing is stored. Values below min or above max show a message under the field.
Submission value
The answer is stored as a number. The field’s name is its key in submission data.
Example
{
"type": "number_input",
"name": "team_size",
"label": "How many people are on your team?",
"subtext": "Include full-time team members.",
"min": 1,
"max": 500,
"defaultValue": "5",
"required": true
}