jquery.AreYouSure
jquery.AreYouSure copied to clipboard
Check for dirty fields in modal dialog
How can i enable the are you sure check in a modal dialog? Currently what happens is that it only displays the are you sure check when i close the dialog and try to either re-load or switch pages.
I found a way around this.
- I turned on the silent mode using
$('#form').areYouSure({'silent': true});
- Then i used this
hasClass('dirty')
to check if the form is dirty - Then i added a fancy box to alert the user before proceeding to close the modal dialog