Number input field

Use number_input to collect a numeric answer, such as a team size or quantity.

Configuration

NameTypeRequiredDefaultDescription
typestringYesn/aSet to number_input to select this field type.
namestringYesn/aAt least 1 character. Use letters, digits, and underscores, starting with a letter. This is the field’s key in submission data.
labelstringNoNoneMain question text. Supports {{field}} piping.
subtextstringNoNoneSmaller text under the label. Supports {{field}} piping.
input_labelstringNoNoneSmall text above the input. Supports {{field}} piping.
requiredbooleanNofalseSet to true to require an answer before the respondent leaves the page. A required field shows * after its label.
visible_ifcondition arrayNoNone (always shown)Show the field only when the condition is true. An empty array hides it. See shared field properties.
hide_ifcondition arrayNoNone (never hidden)Hide the field when the condition is true. See shared field properties.
minnumberNoNone (no lower limit)Any number. Lowest value accepted without a message.
maxnumberNoNone (no upper limit)Any number. Highest value accepted without a message.
defaultValuestringNoNoneA 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 }