Question T4586
Visible to All Users

Previous button only go back one question

created 5 years ago

I just want to say first that you have a really wonderful thing going on here.

I am working on a one-question-per-page survey with conditional rules and will include the navigation buttons for Previous, Next, and Complete. I'm using the VisibleIf for each page so that specific page will only show up if a specific choice were selected. This works well if answered sequentially, but issues arise when someone tries to go back more than one question. I am trying to check if there is a way so that responders can only go back one question just in case they want to modify an answer.

I appreciate any response.

Thanks!

Comments (2)

    Hello,

    There are no declarative means to implement this behavior. You can programatically hide the "Previous" button if you pressed it once or according other your requirements. You can also implement a custom navigation as shown in this sample - https://www.surveyjs.io/Examples/Library?id=survey-customnavigation&platform=jQuery&theme=modern

    If I have not got you right please explain your scenario in greater details.

    Thanks, Serge
    SurveyJS Team

      As alternative you can use survey.onCurrentPageChanging and use option.allowChanging and option.isPrevPage properties. If an end-user tries to go back on more pages you want him then set the option.allowChanging to false and show the alert.

      Thank you,
      Andrew
      SurveyJS Team

      Answers

      created 5 years ago

      Thanks for these suggestions. Programming to set to "hide" the Previous button when clicked, then consequently remove the "hide" when Next is clicked seems like a viable solution. I'll also look into using the alternative that Andrew pointed out and trigger option.allowChanging to set to false when on a Previous page.

      Thanks and have an awesome day to both of you

        Comments (1)

          You are welcome!

          Andrew
          SurveyJS Team