Question T2801
Visible to All Users

Remove Dropdown option from custom Field

created 5 years ago

Hello,

I have added dropdown type custom field. I want to remove option for allow to select other option. I don't want that user able to change it.
Screenshot attached.

How can I do that? Please Advise.

Thanks

Answers approved by surveyjs Support

created 5 years ago

Hello,

You need to handle the onElementAllowOperations event as shown in the documentation - https://surveyjs.io/Documentation/Survey-Creator/#adorners :

JavaScript
surveyCreator.onElementAllowOperations.add(function (sender, options) { var obj = options.obj; //It it is a text question. Here you need to check your custom question type if (obj.getType() == "text") { //disable changing type options.allowChangeType = false; } });

Thanks, Serge
SurveyJS Team