Configure Question Titles
You can specify the title
property to set a question title. If you leave it unspecified, the question displays its name
value as a title. However, question titles can have additional elements that you can configure, such as question numbers and required marks.
Question Numbers
Questions are numbered starting with 1. If you want to start numbering with a different number or use letters instead, specify the Survey's questionStartIndex
property. You can include desired prefixes and postfixes in the property value:
const surveyJson = {
// ...
"questionStartIndex": "a.", // a., b., c., ...
"questionStartIndex": "#3", // #3, #4, #5, ...
"questionStartIndex": "(B)." // (B)., (C)., (D)., ...
}
Surveys use continuous numbering across all pages. If you want to start numbering on each page from scratch, set the Survey's showQuestionNumbers
property to "onpage"
:
const surveyJson = {
// ...
"showQuestionNumbers": "onpage"
}
If you want to hide question numbers, set the same property to "off"
:
const surveyJson = {
// ...
"showQuestionNumbers": "off"
}
Required Mark
Questions that require an answer are marked with an asterisk *
. You can use the Survey's requiredText
property to set another symbol or specify an explanatory text string:
const surveyJson = {
// ...
"requiredText": "!"
}
Title Pattern
You can arrange the question title, number, and required mark in different sequences. To do this, specify one of the questionTitlePattern
property values as shown in the following code:
const surveyJson = {
// ...
"questionTitlePattern": "numTitleRequire", // 1. Question Title *
"questionTitlePattern": "numRequireTitle", // 1. * Question Title
"questionTitlePattern": "numTitle", // 1. Question Title
}