SilverStripe: Stay on page leave page are you sure
I've added a checkbox for GridField records so that one can perform mass-actions. However, if a checkbox is checked and an action-button is clicked, this messagebox appears:
Are you sure? This page is asking you to confirm that you want to leave - data you have entered may not be saved. Stay on Page - Leave Page
Add "no-change-track" as CSS-class to the checkbox input elements.
I found about this from comments in the SilverStripe source code file
- Change tracking is enabled on all fields within the form. If you want to disable change tracking for a specific field, add a "no-change-track" class to it.
window.onbeforeonload = null when button is clicked but nothing happens.