Modal delete confirmation How do I get a confirmation message to show as a modal dialog?

$form['mytable'][$id]['operations']['delete'] = array(
  '#type' =&gt; 'submit',
  '#value' =&gt; t('Delete'),
  '#name' =&gt; 'd' . $entity-&gt;ref,
  '#attributes' =&gt; array('onclick' =&gt; 'if(!confirm("Really Delete?")){return false;}'),
);


I've looked at the Colourbox module and OpenModalDialogCommand but I don't know how to integrate this into #attributes.
See https://www.drupal.org/node/2253257, wich would do this by default.

It's pretty easy to do it for your own link, note that the patch there is out of date. Instead of the accepts thing, you simply put data-dialog-type and data-dialog-options on your link attributes. See also https://www.drupal.org/node/2488192 that describes this change and contains lots of examples.