Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to catch browser events to do validations

Hi,

How to catch browser events to do validations especially when user try to close browser directly without cancelling upload using some button or some other file saving functionality.

need to clear uploaded files or earlier steps related data whenever user tries to close browser.

Please share recommendation to deal this browser close approach.

Regards,

Koti Reddy

Former Member
replied

That is standard Javascript functionality -- the window.onbeforeunload hook -- which even made it's way to the core Component

Message was edited by: Robin van het Hof Made a typo, should of course be window.onbeforeunload, not window.unload... The former allows to show a popup, the latter only allows for cleanup etc, and is not really suited for validation

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question