Knowledge Base
/
JavaScript Tricks
Alert Before Leaving A Survey Page Using JavaScript
You can add this script to a theme extension (usually in custom.js), to warn a user if they try to leave your survey:
(window).on('beforeunload', function(){
var c=confirm();
if(c){
return true;
}
else
return false;
});
358
of
675
people found this helpful.
Powered by LiveZilla Website Chat Software