Shared Question Schema Properties
Base properties shared by all question types.
Element type: question
Key properties: 25
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.
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.
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).
descriptionLocation
Section titled “descriptionLocation”- Type:
string - Default:
"default" - Allowed values:
default,underInput,underTitle
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:
"300px"
Gets or sets minimum form element width in CSS values.
maxWidth
Section titled “maxWidth”- Type:
string - Default:
"100%"
Gets or sets maximum form element width in CSS values.