Hello,
When I set a multiple lines string in the defaultValueExpression property of a comment question it doesn't work.
Thanks for help.
defaultValueExpression for comment question
Answers approved by surveyjs Support
Hello Mohamed,
Thank you for the update. As you use the defaultValueExpression
property, you are expected to pass an expression rather than a string literal. So, you can fix your Comment question definition by enclosing a string within a single quotes.
JSON{
elements: [
{
type: "comment",
name: "question1",
defaultValueExpression: "'aaaaaaaaaaaa\nbbbbbbbbbb'"
}
],
showQuestionNumbers: false
}
A survey appears as follows:
Please let me know if you have any further questions.
Hello Mohamed,
Would you please share an example of your
defaultValueExpression
string? If possible, share a full Comment question definition.{
"type": "comment",
"name": "question1",
"defaultValueExpression": "aaaaaaaaaaaa\nbbbbbbbbbb"
}