开发者

ExtJS: Ensure that user submit the form

开发者 https://www.devze.com 2023-02-13 18:27 出处:网络
I got several form when user can make various calculation. Forms provide results after user fills in input fields, when most of them or all are filled in onChange event will calculate and display resu

I got several form when user can make various calculation. Forms provide results after user fills in input fields, when most of them or all are filled in onChange event will calculate and display result.

Results need to be saved by submiting the f开发者_C百科orm. Some of user are happy to see result and do not proceed with submit / save operation by closing browser or leaving the page.

How I can catch those action and enforce them to save operation in ExtJS ?


You could set up an event listener on the onbeforeunload event, testing to see if the user submitted the form or not. Check out:

https://developer.mozilla.org/en/DOM/window.onbeforeunload

0

精彩评论

暂无评论...
验证码 换一张
取 消