Alert for unsaved changes in form

前端 未结 7 1909
谎友^
谎友^ 2020-11-30 18:47

I want to write Jquery code in master file, so that if there if user changes page and there is any unsaved changes user should get alert. I got one answer from this: link

7条回答
  •  感动是毒
    2020-11-30 19:32

    I use $('form').change etc. function to set a dirty bit variable. Not suitable to catch all changes (as per previous answers), but catches all that I'm interested in, in my app.

提交回复
热议问题