unsaved changes alert native Mobile

0
Hi Team, I just came across one scenario where we need to detect form changes in Native mobile while user is Navigating to other page. Any suggestion is most welcome. 
asked
2 answers
0

hii vijaybir singh 

you can use some logic like 

  1. $(window).on('beforeunload', function () {
  2.     if ($('.changed-input').length) {
  3.         return 'You haven\'t saved your changes.';
  4.     }
  5. });

you can directly call a function on change of input and make a variable set false and when there is input length >0 then make variable true else make false 

and before navigate on other page check variable is true or not if true return a confirm prompt 

for example 

var _isDirty = false;
$("input[type='text']").change(function(){
  _isDirty = true;
});
// replicate for other input types and selects

i hope this will help you 

answered
0

Hi Vijaybir,

I don’t know if it works for native, usually there is an App Store module to detect changes and show a message,

https://marketplace.mendix.com/link/component/21721

You could try this or something similar,

 

Ashok

answered