Question T6786
Visible to All Users

How to show error that occurs on saving survey response?

created 4 years ago (modified 4 years ago)

[Ticket cloned from T6754: Is it possible to change the button color after klick or touch on Next, Prev, Start, Compled buttons?]

Dear Andrew,

Great. Thanks a lot. We found some problem and could improve the loading time. It is ok now.

Yesterday we travelled inside a train and used mobile connection to fill out the questionnaire on a test environment. Inside the train we saw that the mobile connection was not stable and not fast. Anyway, we finished our test survey, got the confirmation page on our smartphone, but we couldn’t find the data in the database.
Can we implement an additional checking system, if the answer-data is really stored in database successfully? We use mariadb system.

Again, thanks a lot for your support.
Chris

Answers approved by surveyjs Support

created 4 years ago

Hello Cris,
You should return the error from the server if for some reason data is not saved. Here is the docs that shows what should you do on the client with SurveyJS.
Please google to find out how to process database and other errors correctly for your database and server platform.

Thank you,
Andrew
SurveyJS Team

    Comments (2)

      Dear Andrew,

      Thanks again for your very quick reply. We use this method, looks different to your example:

      Code
      survey<?php echo $id ?>

      .onComplete
                          .add(function (result) {
                              jQuery.ajax({

      Code
      url:  "<?php echo esc_url($saveResultUri) ?>",

      type: "POST",

      Code
      data: { SurveyId: '<?php echo $id ?>', Json : JSON.stringify(result.data) },

      success: function (data) {}
                              });
                          });

      Can we implement there also a status-data-transmitting bar, error and try again messages?

      Thanks for your support,
      Chris

        Hello Chris,
        I am sorry, but we are not PHP experts here. Please google it or ask questions on PHP forums.
        Please read this article. It will help you to get a full picture of our products. Our libraries are server agnostics and we do have the Server part, it is on you.

        Thank you,
        Andrew
        SurveyJS Team