Shared Question Schema Properties
Base properties shared by all question types.
Element type: question
Key properties: 31
Usage Notes
Section titled “Usage Notes”- Use these properties on any value-producing question unless a type-specific page says otherwise.
- For choice questions, also use Shared Choice Question Properties.
- For validator objects, use Validators Overview.
Key Properties
Section titled “Key Properties”- Type:
string - Default:
— - Required: Yes
A form element identifier.
- Type:
text - Default:
— - Localizable: Yes
A title for the form element. If title is undefined, the name property value is displayed instead.
description
Section titled “description”- Type:
text - Default:
— - Localizable: Yes
Explanatory text displayed under the title.
isRequired
Section titled “isRequired”- Type:
switch - Default:
—
Makes the question required. If a respondent skips a required question, the survey displays a validation error.
requiredIf
Section titled “requiredIf”- Type:
condition - Default:
—
A Boolean expression. If it evaluates to true, this question becomes required.
visibleIf
Section titled “visibleIf”- Type:
condition - Default:
—
A Boolean expression. If it evaluates to false, this question becomes hidden.
enableIf
Section titled “enableIf”- Type:
condition - Default:
—
A Boolean expression. If it evaluates to false, this question becomes read-only.
readOnly
Section titled “readOnly”- Type:
switch - Default:
—
Makes the form element read-only.
readOnlyMode
Section titled “readOnlyMode”- Type:
string - Default:
"default" - Allowed values:
default,readonly,view
How the question looks while it’s read-only, from readOnly, an enableIf that is false, or a read-only parent. readonly shows the usual input, disabled. view shows the answer as plain text or another non-interactive display. default inherits from the panel, page, or form root, whose default is readonly. Pages and panels accept the same property.
defaultValue
Section titled “defaultValue”- Type:
value - Default:
—
A default value for the question. Ignored for question types that cannot have a value (for example, HTML).
defaultValueExpression
Section titled “defaultValueExpression”- Type:
expression - Default:
—
An expression used to calculate the defaultValue.
correctAnswer
Section titled “correctAnswer”- Type:
value - Default:
—
The answer used for secure quiz grading. Formspace removes this property from respondent-facing form payloads and evaluates it server-side on submission.
- Type:
number - Default:
1when the question hascorrectAnswer
The point value for a quiz question. Only applies when the same question also has correctAnswer. If omitted, Formspace treats the question as worth 1 point. Formspace removes this property from respondent-facing form payloads and evaluates it server-side on submission.
validators
Section titled “validators”- Type:
validators - Default:
—
Question validators.
valueName
Section titled “valueName”- Type:
string - Default:
—
Specifies an object property that should store the question value.
clearIfInvisible
Section titled “clearIfInvisible”- Type:
string - Default:
"default" - Allowed values:
default,none,onComplete,onHidden,onHiddenContainer
Specifies when to clear the question value if the question becomes invisible.
resetValueIf
Section titled “resetValueIf”- Type:
condition - Default:
—
A Boolean expression. If it evaluates to true, the question value is reset to default.
setValueIf
Section titled “setValueIf”- Type:
condition - Default:
—
A Boolean expression. If it evaluates to true, the question value is set to a value calculated using the setValueExpression.
setValueExpression
Section titled “setValueExpression”- Type:
expression - Default:
—
An expression that calculates the question value.
showNumber
Section titled “showNumber”- Type:
boolean - Default:
true
Specifies whether to show a number for this question. Setting this property to false hides the question number from the title and excludes the question from numbering.
showTitle
Section titled “showTitle”- Type:
boolean - Default:
—
titleLocation
Section titled “titleLocation”- Type:
string - Default:
"default" - Allowed values:
default,top,bottom,left,hidden
Sets question title location relative to the input field. Overrides the questionTitleLocation property specified for the question’s container (survey, page, or panel).
allowClear
Section titled “allowClear”- Type:
boolean - Default:
false(trueforsignaturepad)
Shows a Clear button in the question title that returns the answer to unanswered. It’s most useful on questions respondents can’t otherwise clear, such as radiogroup, boolean, imagepicker, matrix, rating, and slider. The button needs a visible title. dropdown and tagbox use the property for their own clear control, and signaturepad for its Clear button. buttongroup, file, html, image, expression, matrixdynamic, and paneldynamic don’t show it.
showKeyboardHints
Section titled “showKeyboardHints”- Type:
boolean - Default: inherits the form root’s
showKeyboardHints(false)
Shows hints for the keyboard actions the question supports, such as typing a choice’s letter or pressing Enter to continue. Hints are hidden on touch devices, in read-only and preview modes, in collapsed questions, and in matrix cells.
allowFiltering
Section titled “allowFiltering”- Type:
boolean - Default:
true
Whether a Filter element offers this question as a field to filter by. Applies to questions in a paneldynamic template; matrixdynamic and matrixdropdown columns have the same property. Set it to false for internal or noisy fields.
descriptionLocation
Section titled “descriptionLocation”- Type:
string - Default:
"default" - Allowed values:
default,underInput,underTitle,hidden
Specifies where to display a question description.
errorLocation
Section titled “errorLocation”- Type:
string - Default:
"default" - Allowed values:
default,top,bottom
Specifies the error message position. Overrides the questionErrorLocation property specified for the question’s container (survey, page, or panel).
startWithNewLine
Section titled “startWithNewLine”- Type:
boolean - Default:
true
Disable this property if you want to render the current question on the same line or row with the previous question or panel.
- Type:
string - Default:
—
Sets form element width in CSS values.
minWidth
Section titled “minWidth”- Type:
string - Default:
—
Gets or sets minimum form element width in CSS values.
maxWidth
Section titled “maxWidth”- Type:
string - Default:
—
Gets or sets maximum form element width in CSS values.