Question T6937
Visible to All Users

Custom Widget on Survey

created 4 years ago

Hi there,

I'm able to add custom widget on Survey Creator but it's not visible on Survey page. What should be done to make it visible and ready to answer?

Answers approved by surveyjs Support

created 4 years ago

Hello,
It means that you missed JavaScript file(s) related to your custom widget on the page where you run SurveyJS Library (survey runner).
SurveyJS loads your JSON, could not find the type of your custom widget, ignore this question and add an item into survey.jsonErrors array.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (7)

      Just want to remind that it works on Creator page where I use only survey-KO version.

        Hello,

        Probably you need to register the custom widget in the survey-angular library also:

        JavaScript
        import * as Survey from 'survey-angular'; const fileUploadWidget = new FileUploadCustomWidget(); Survey.CustomWidgetCollection.Instance.addCustomWidget(fileUploadWidget, 'customtype');

        Thanks, Serge
        SurveyJS Team

          Hello,
          If you have SurveyJS Creator and SurveyJS runner on your page, then you have to register them in SurveyKO and in Survey. There are two instances and they are separated.

          PS: We will have survey-core and survey-angular-ui in V2. You will have to register in survey-core module only that will be shared by Creator and Survey runner. However, for the first version they run two separate SurveyJS Library instances.

          Thank you,
          Andrew
          SurveyJS Team