Question T13754
Visible to All Users

Change the color of a question's comment text

created 2 years ago (modified 2 years ago)

[Ticket cloned from T13553: Display a comment box for every survey question in PDF]

Thanks Jane for your response working fine now!

Just one more question, Can you tell us, How we can update comment color to gray?

Answers approved by surveyjs Support

created 2 years ago

Hello Santosh,
To change the color of a question's comment, you can obtain a Comment box brick from options.bricks and change its textColor attribute. Consider this demo:

JavaScript
surveyPDF.onRenderQuestion.add((survey, options) => { ... // Change the color of a comment if (!!options.bricks[1]) { var questionCommentBrick = options.bricks[1].unfold()[1]; questionCommentBrick.textBrick.unfold()[0].textColor = "gray"; } });

View Demo

Let me note that the structure of PDF bricks may vary depending on a question's structure. You can research the structure of a question's bricks and determine a required brick.

Should you have any questions or require further assistance, we are here to help.