Question T9387
Visible to All Users

Change question css style onValueChanged

created 3 years ago (modified 3 years ago)

Is there a way that I can change the changed question style inside the onValueChanged handler? I try to use const element = options.question.element;
and set the style property, but this doesnt work in all elements, and I want to change the style for date input ?

Answers approved by surveyjs Support

created 3 years ago

Hello,
You can't do it. What do you want to achieve?

Thank you,
Andrew
SurveyJS Team

    Comments (2)

      I am showing the date input values with a bolder font and a blue color if there is a value, and normal font gray color if no value(which means the date place holder will show mm/dd/yyy). On inital load I am able to achieve this using the onAfterRenderQuestion event, but for example when a empty date is provided with a value, the color and font weight should be changed. Dont know if something like this is possible.

        Hello,

        You can simply add your css name to question answered style.

        Code
        Survey.defaultV2Css.question.answered += " yourClassName";

        Here is the example.

        Thank you,
        Andrew
        SurveyJS Team