Good day all
We use the following code on classic designer to send a pop up message to the user telling them they need to save data before leaving the form.
Please can I ask for assistance for this to work on the new modern forms designer
Thank you
$(document).ready(function() {
// Check if browser is closed without submitting, then raise alert
canLeaveForm = false;
$('.form-q').change(function(){
canLeaveForm = false;
});
window.onbeforeunload = function()
{
if (!canLeaveForm)
{ return 'Are you sure you want to leave this page without saving changes?'; }
else
{ return; }
}
$('.Submit').on('click', function() {
var noErrors = true;
$('#form1').parsley().validate();
$('.parsley-error').each(function() {
noErrors = false;
});
if (noErrors) { canLeaveForm = true; }
});
});