Problem
There is currently no standard (and easy) way in Drupal's Form API to allow for a user friendly form submission confirmation step.
We have ConfirmFormBase
which can be used as a separate form for a single action, this is not fit for a multi-step flow in which you first want to gather input from the user. And it is especially not straightforward to ask for extra (to be validated) input during a confirmation step.
Exemplary is the current edit account page. In this case the Edit action and Confirm action are put together on the same page. Several usability studies, including the issue below, show that this pattern is confusing to users.
https://www.drupal.org/node/1259892
But also the new Content Layout functionality could benefit from this new option.
Solution
Introduce a confirmation modal, which optionally allows for extra user input that can be validated.
This allows for easily separating two dedicated user interaction steps from each other. So users only need to deal with one step at a time, and by using a modal the urgency is more clear and allows for a more fluid interaction.
By providing a standardized solution to this problem contrib can also create better forms.
Example
Please see how it can work in the following prototype.
This prototype uses the Edit Account page as an example. When submitting changed field(s) that require the current password to apply, show a modal window asking the user to confirm the changes by entering the current password.
http://prototype.goalgorilla.com/drupalux/currentpassword/#g=1&p=edit_ac...
API changes
We would need some new properties/methods to the Form API that allow to:
- Set that a form submission confirmation is always needed OR set a list of fields that need confirmation on change
- Give a custom confirmation form (class), which defaults to a default confirmation form like ConfirmFormBase
.
Other examples
This design pattern is also widely used by other services.
Mailchimp:
Hubspot: