Issue T14029
Visible to All Users

Ignore validation to navigate to next page but keeping the error messages

created a year ago

Hi Everyone,

I have a very long survey and we would allow the user to move between the different survey pages even if there are required questions not answered. Then I want to validate all the questions at the end of the survey before the final submission.

I found this very useful old ticket: Moving between pages without validation
from which I discovered the possibility to set this property:

Code
this.model.ignoreValidation = true;

Thanks to this property I was able to allow the navigation between the different pages but now I have an issue. Because of the ignoreValidation now the Survey stopped to validate the questions.
Is there a way to allow the user to move between the different pages but keeping the validation rules/messages, ex. the fact that a required field becomes red, or that a numeric field cannot be filled with chars etc.

I was thinking to simply override the default next button behavior, or should I implement a custom navigation buttons as described here ? (The Angular example has not been implemented)

Another possibility I was thinking, is to disable the ignoreValidation flag when the user arrives to the complete button. But then I will have again the navigation problem.

Hoping my requirements are clear, do you have any suggestions?

Cheers,
Paolo

Answers approved by surveyjs Support

created a year ago

Hello Paolo,
You can set survey.checkErrorsMode to "onComplete". It does what you need out of the box.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (10)
    AT AT
    Andrew Telnov a year ago

      Hello Paolo,
      Indeed, I did not write the unit test correctly and as result introduce another issue. I have written another unit test, recheck that it works correctly locally and create a new PR. It will fix the issue.
      The fix will be available in the version we will release next week. We release new version every weekly.

      Thank you,
      Andrew
      SurveyJS Team

        Hi Andrew,

        Thank you so much for swiftly fixing the bug I reported. I will check the new library version.

        Regards,
        Paolo

        AT AT
        Andrew Telnov a year ago

          You are very welcome and sorry for being sloppy on this issue with the first fix.

          Thank you,
          Andrew
          SurveyJS Team