Question T2057
Visible to All Users

Create the questions in popup model inside the survey page

created 6 years ago

Hi guys, I 'm finding out the way to create the questions in popup model inside the survey page.
In my survey, I want to have some questions in normal page and some questions are display in popup model.

I don't know if the surveyjs can support me to do that.

Answers approved by surveyjs Support

created 6 years ago

Hello,
The easiest solution is two have two surveys.
You may then join the results (two jsons) later and store them in your database as one result.

Thank you,
Andrew
SurveyJS Team

    Other Answers

    created 6 years ago (modified 6 years ago)

    Hi Andrew,

    Sorry Seem to be You are misunderstanding my idea. I mean that I want to have the survey that contain some questions are display in popup, such as we have 2 pages.

    Page 1:
    -. Question 1
    -. Question 2
    -. Question 3 and question 4 was displayed in popup (they are mandatory field)
    -. Question 5

    Page 2:

    So how can I implement the question 3 and question 4 in popup and check the mandatory field before going to the second page. Hoping that you can understand what I meant

    Thanks,
    Tuan Nguyen

      Show previous comments (2)

        Hello Tuan,
        I guess, you will need to take a look at the custom navigation example . On going page X, hide the current survey html div element and show modal window with the survey, then onCompleting the survey in modal window, go to the next page in the survey on the page and show the survey div element again.
        Use the ideas and code from example I gave you before and navigation example and you will be able to code your task.

        Thank you,
        Andrew
        SurveyJS Team

          Hi Andrew,

          Thanks for your reply. If I want to create the custom surveyjs component (In fact that It is a datepicker was display in a popup). How can I inject this component into another component and use it as a question type?

          Thanks you,
          Tuan Nguyen

            Hello,

            I've created a separate ticket on your behalf (T2095: How to use datepicker widget as a question). It has been placed in our processing queue and will be answered shortly.

            created 6 years ago (modified 6 years ago)

            Hi Andrew , Thanks for your reply.

            As I understook, two surveys will be exist in the same page. First survey will be display in popup, second survey will be display in normal page. I created two jsons definition.
            childJson = {
            title: "Popup",
            pages: [
            {
            questions: [
            {
            type: "text",
            name: "name ",
            title: "name ",
            },
            }
            ]

            parentJson = {
            title: "Normal page",
            pages: [
            {…},
            {…},
            {…},
            {…},
            ]
            I 'm wondering what 's happen when we click the button 'Next' on first page (Imagine that we have 4 pages and the first survey in popup will be on first page. In additional, In the first page we also have some questions that display normally) So how can we check the data constraint if the data survey in popup didn't fill anything before going to the next page.

            It seems like that I approached with a wrong way. I think I need to create new custom surveyjs component(first survey) that show the survey popup in angular and then register it in the other component (second survey) So how can I do that?
            do you have any feedbacks/ suggestions?

            Thank you,
            Tuan Nguyen

              Comments (1)

                Hello Tuan,
                I am not sure I completely follow you. So, you want your users go fill two surveys one by one. At first the first survey and the immediately the second one.
                So, you should have two surveys as you already did, then on survey.onComplete event the first survey start the second survey immediately. You may pass the results of first to the second survey as: secondSurvey.data = firstSurvey.data;. In this case the second survey will have survey results for the first and second surveys.

                Thank you,
                Andrew
                SurveyJS Team