Open JaneSjs opened 9 months ago
We researched this task. Currently, a Boolean question rendered as 'checkbox' renders the labelTrue
and labelFalse
labels in PDF. Unfortunately, we may not change this behavior in the meantime and render the label
instead because it may introduce a breaking change. While researching this task, we found another issue which highlights ambiguous settings of the 'checkbox' rendering mode. We may require to rework the 'checkbox' rendering mode in the future and eliminate those issues.
In the meantime, consider the following alternatives.
Option 1: Use the 'checkbox' rendering mode for a Boolean question and set the labelTrue
and labelFalse
properties to the label
text.
You would require to copy the label
to the labelTrue
and labelFalse
properties.
View Plunker
{
"pages": [{
"elements": [
{
"type": "boolean",
"name": "Birthdate_Refused",
"label": "Refused",
"labelTrue": "Refused",
"labelFalse": "Refused",
"titleLocation": "hidden",
"hideNumber": true,
"renderAs": "checkbox",
"valueTrue": 1,
"valueFalse": 0
}
]
}]
}
Option 2: Use the Checkbox question instead of a Boolean question. With this option, you would configure a regular Checkbox question with a single check item. Consider the following demo: View Plunker
{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "checkbox",
"name": "Birthdate_Refused",
"title": "Birthday",
"hideNumber": true,
"choices": [
{
"value": "refused",
"text": "Refused"
}
]
}
]
}
]
}
User Issue: T16746 - survey-pdf https://surveyjs.answerdesk.io/internal/ticket/details/T16746
View Demo
In a survey runner:
In PDF:
Expected behavior: in PDF, a
label
appears beside a checkbox.