Moved the confirmation dialog to the form element. Previously, it was still submitting the form even when pressing Cancel.