javascript - beforeunload event and JQuery Dialog immediately closes after switch screen -
good day,
here structure of .php
main.php
of navibar here. there's iframe screen contents.
content1.php
content 1 contains textfields. jquery dialog if leaving screens.
content1 code :
$(window).bind('beforeunload', function(e){ dialog(); });
dialog();
$('form[name="rowform"]').on('submit', function (e) { e.preventdefault(); }); var fieldnamestocheck = xxxxx; var previousvaluefieldnames = xxxxx; if (detectchangesoninputs(fieldnamestocheck, previousvaluefieldnames)) { $("#unsaved-values-confirmation-dialog").dialog("open"); $('.ui-dialog :button').blur(); }
for close , refresh event, beforeunload event fine. when start hitting navibar, happen is, dialog shows , closes.
is there wrong in codes? thanks!
Comments
Post a Comment