It's difficult to avoid mistakes on a page with one button

Sometimes in an attempt to reduce mistakes I’ll remove submit-behavior by not having a submit button for a form. The user can’t continue without clicking, which is important for pages that are going to send an email or do another irreversible action.

But, it’s now invalid to have a page without a submit button.

EWF does not allow form controls to use HTML’s built-in implicit
submission on a page with no submit button. There are two reasons for
this. First, the behavior of HTML’s implicit submission appears to be
somewhat arbitrary when there is no submit button;…

Okay, what’s the other method we use to prevent mistakes? Confirmation dialog. Oh, wait:

PostBackButton cannot be the submit button and also have a confirmation message.

Alright then. The only other option we have is to create a completely separate page to act as the confirmation dialog before performing the action, which is heavyweight.

1 Like

It’s not invalid to have a page without a submit button. You just need to pass a PostBack object into every form control.

Passing PostBack to the objects adds enter behavior, the thing we’re avoiding.

Ok. If you’re trying to protect users from accidentally triggering an irreversible action, I’d recommend using a confirmation dialog like you said above. You can currently do this by using a non-submit button and passing in the PostBack to all of the form controls. With a little bit of EWL work, we could probably make submit buttons support confirmation dialogs too.

I remember talking about and deciding in a meeting not to support confirmation dialogs on submit buttons. Does anyone know what that reason is? The only thing I can think-of is the [possible] difficulty of intercepting the browser submitting the form.

That difficulty of intercepting is all I can think of, too. And it’s probably not very hard anymore in this age of evergreen browsers that are more standards-compliant.