Currency field
Use currency_input to collect a money amount from a respondent. Currency-specific settings control the placeholder and the currency symbol shown with the amount.
Configuration
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | Yes | n/a | Set to currency_input. |
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 | Whether the respondent must answer before leaving 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 properties. |
hide_if | condition array | No | None (never hidden) | Hide the field when the condition is true. See shared properties. |
placeholder | string | No | 0.00 | Grey hint text inside the input. Supports {{field}} piping. |
defaultValue | string | No | None | Prefills the input with a number written as a string, such as "49.99". May be "{{hidden_name}}". |
currency | string | No | USD | ISO currency code, such as USD, EUR or GBP. The corresponding symbol appears before the amount; if the code has no known symbol, the code appears instead. |
The amount is displayed with thousands separators and two decimals. The shared properties also define how the field behaves when required, hidden, or conditionally shown. See shared properties.
Respondent validation
A required field with no answer blocks the respondent from continuing. Characters other than digits and the decimal point are dropped as they type. Hidden fields are skipped during validation.
Submission value
The field stores a number, or null when empty. Its name is the key in submission data. For example:
{
"donation_amount": 49.99
}Example
{
"type": "currency_input",
"name": "donation_amount",
"label": "How much would you like to donate?",
"subtext": "Choose an amount in US dollars.",
"input_label": "Amount",
"placeholder": "25.00",
"defaultValue": "49.99",
"currency": "USD",
"required": true
}