Open Lionqueen94 opened 3 years ago
I seem to have an issue with navigateToUrl
. When I add it to the json, my survey does not get saved onComplete
, it redirects to the navigateToUrl
straight away. When I remove it from the json, my survey does get saved and I have to go to a different page myself, without a popup warning that data might not be saved.
EDIT: This happens on a multi page survey.
@Lionqueen94 We do not show this dialog or alert. I believe a browser does it.
Regarding navigateToUrl. We can navigate to url from here and here. The first code calls when you are getting from your server that survey results were saved successfull, the second code when you are just calling the your service code without checking if results were save or not. Here is examples of two approaces. You need the second one, because otherwise your user can leave the page before the code that send the data to your server fully executed.
Thank you, Andrew
@andrewtelnov When I use the approach you explained, I keep having the browser popup, but when I call this function:
function redirect() {
window.onbeforeunload = null;
window.location.href = url;
}
from the success()
in my ajax call I prevent the popup and it works fine.
Another question, is there a way to wait for OnPartialSend
to finish before loading the next page?
@Lionqueen94 We do not wait for onPartialSend
event. We are waiting for server validation event only.
PS: Please create a new issue for new question.
Thank you, Andrew
@andrewtelnov Ok that makes sense why my code was working when I was saving the data in the onServerValidateQuestions. Thanks for your reply and next time I'll add a new issue/question.
Are you requesting a feature, reporting a bug or asking a question?
Reporting a bug
What is the current behavior?
I have implemented
onServerValidateQuestions
to validate my survey data andonComplete
to save the data and I have added anavigateToUrl
. When I submit my survey, I get a popup with:This page is asking you to confirm that you want to leave - data you have entered may not be saved.
Only when I click onLeave Page
, I get redirected to thenavigateToUrl
. EDIT: This happens on a 1 page survey. EDIT2: When I remove thenavigateToUrl
from the json, the data is saved but I still get the popup when I click on a different page to go to.What is the expected behavior?
I do not want to see the popup, because I'm saving the data so there is no risk of losing data on leaving the page.
Specify your