3

I have a survey page that created with SurveyJS lib(survey-react) and I have 2 problems:

  1. I want to query back-end server when I click 'Next' button in the survey , if server return a true , then jump to next page , if false , stay in current page and do something else.

so what I need are:

1.to handle the event of 'Next' button myself.
2.to trigger next or previous event manually.

and the second problems is, if I have 2 input element in survey , and I want to show validation message if the amount of these two input more than 100.

is there a way to do these 2 requirements? img

update: now I override the 'Next' button event by getElementsByClassName , it can excute my function, but still trigger 'nextPage()'. is there a way to prevent the default event?

ashleedawg
  • 20,365
  • 9
  • 72
  • 105
jjzjx118_2
  • 419
  • 7
  • 23

1 Answers1

0

You can hide built-in navigation and create your own. It about 10-20 lines of code. Here is the live sample - https://surveyjs.io/Examples/Library?id=navigation-custom&platform=Reactjs&theme=modern

TSV
  • 7,538
  • 1
  • 29
  • 37
  • And here is stand alone plunker sample - https://plnkr.co/edit/oQyzZu1cu6VLiymC – TSV Dec 22 '20 at 07:32