Open modal

Using the "dialog" method for forms

If you set a form's method to "dialog", a modal can be dismissed by submitting that form. This is convenient as it requires no additional javascript.

When the form is submitted, the modal's returnValue is set to the value of the submit button that was clicked.

A button can be associated with a form, by setting the button's form attribute to the form's id.