Question T6724
Visible to All Users

surveyjs builder

created 4 years ago (modified 4 years ago)

Hello,

I have added a switch name "show textarea" same like isRequired see the attached screen shot and when toggled yes i want to show textarea in the question but i didn't find event that is fired when switch is toggled.

Also it is a custom widget. I tried using this event:

Code
question.registerFunctionOnPropertyValueChanged("showTextarea"(newValue) => { }

Clipboard-File-1.png

Answers approved by surveyjs Support

created 4 years ago

Hello,
If you choose a custom widget path then you use the correct function: question.registerFunctionOnPropertyValueChanged("showTextarea", (newValue) => { }. You have to put it into your afterRender custom widget function and change the htmlElement DOM accordingly.
However, I strongly suggest to go with our component. Here is the documentation and working example that works very close to your case. Please take a look at "showMiddleName" property.

Thank you,
Andrew
SurveyJS Team

    Comments (1)
    SS SS
    shrestha shital 4 years ago

      Thanks! it worked.