ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Popupform exit confirmation
Title:
B
I
{code}
?
I want to know if it's possible to set a confirm dialog when the user click on the icon at top-right to close the popupform. And if so how. I found this confirm dialog on submiting http://aspnetawesome.com/forum/question/530/attaching-a-confirm-dialog-to-ok-button-of-popupformaction but I didn't found any clues on how to on exit. Thanks !
Save Changes
Cancel
Pharm
asked at 20 Mar 2014
you can also exit the popup by hitting Esc, you can prevent this by writing custom js, like here: http://stackoverflow.com/a/6735024/112100, you can put the js in the content of the popup so it will execute when the popup is loaded, the popup has an id like name-awepw (use chrome tools to look at html)
at 20 Mar 2014
Omu
Oh thanks ! It wasn't so difficult with your help. Here is the code for other who look for this solution: $(function () { $( "#idPopUpWindows" ).dialog({ beforeClose: function(event, ui) { return confirm("Are u sure you want to quit ?") }}); }); Bonus : The confirm dialog is show in native language for user.
at 21 Mar 2014
Pharm
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK