API to trigger prompt on leaving page

The problem is “When the data managed by the plugin is edited. You have to set your own dirty-flag (e.g. a value in a hidden input field, setup a js-variable) and check your dirty-flag if the user leave the page. But how could you check if the data in the metabox is edited? Are there some suitable hooks in the plugin? If not, you can use jQuery/JS OnChange events if the metabox contains input fields. Our simply check the input fields in the metabox (empty or not).

It would be fine to know what the metabox contains or the plugin itself.

Leave a Comment