Confirm dialog in CMS

Silverstripe Version: 4.7.3


How do I display a popup confirmation dialog in the CMS? Eg. similar to how the confirm delete dialog is displayed when user clicks delete button - I have added a custom ‘duplicate’ action button to GridField and detail forms and would like user to confirm the action when clicked.

I am not sure if this the recommended way to go about it but I added a custom.js script to achieve this. e.g.

(function($) {
    $.entwine('ss', function($){
            onclick: function(e) {
				if(!confirm('Are you sure you want to replace all API data?')) {
					return false;
				} else {


If you’ve not used entwine yet:

1 Like