Class: ConfirmSubmit

ConfirmSubmit()

<brut-confirm-submit>

Confirms form submissions with the user before allowing the form to be submitted. This can be applied per submit button and only affects the behavior of button or input type=submit, and only if no other click handler has been put onto those buttons. Note that this does not affect links (a elements).

This can ask for confirmation with external:Window#confirm or a brut-confirmation-dialog. What it will use depends on several factors, all of which are geared toward doing the right thing. Note that setting show-warnings will elucidate the reasons this component does what it does.

  • If dialog is set:
    • If that id is on a <brut-confirmation-dialog> that is used.
    • If not, window.confirm is used.
  • If dialog is not set:
    • If there is exactly one <brut-confirmation-dialog> on the page, this is used.
    • If there is more than one, or no <brut-confirmation-dialog>s, window.confirm is used.

Constructor

new ConfirmSubmit()

Properties:
Name Type Description
message string

the message to show that asks for confirmation. It should be written such that "OK" is grammatically correct for confirmation and "Cancel" is for aborting.

dialog string

optional ID of the brut-confirmation-dialog to use instead of window.confirm. If there is no such dialog or the id references the wrong element type, window.confirm will be used. Setting show-warnings will generate a warning for this.

Source:
See: