Question T3077
Visible to All Users

Restricting Question

created 5 years ago

Hi team ,

I am creating polls application using survey-creator library. As you know poll allow you to ask one multiple choice question . to do that is there any possibility restrict the question while designing the question.

Thanks.

Comments (2)

    Hello,

    Could you please specify - what do you mean under the "restrict the question while designing the question"?

    Thanks, Serge
    SurveyJS Team

      i need to allow my user to create only one question for a survey

      Answers approved by surveyjs Support

      created 5 years ago

      Hello,

      This can be done via the following code (e.g. for the text question):

      JavaScript
      creator.onQuestionAdded.add(function(sender, options) { if(options.question.getType() === "text") { creator.toolbox.removeItem("text"); } });

      Here is the working sample - https://plnkr.co/edit/ZjVHE1k4kFsLtDe7K9Fo?p=preview

      Thanks, Serge
      SurveyJS Team