-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow changing the submitter text during form submission (#869)
This change introduces a new optional data-turbo-submits-with text attribute that can be set on submit elements (inputs or buttons) in Turbo forms. <form action="/" method="post"> <input type="submit" value="Save" data-turbo-submits-with="Saving..."> </form> When the form is in a submitting state Turbo will change the submitter content -the input value for inputs, and the innerHTML for buttons- with the data-turbo-submits-with value, and restore the original value when the submission ends. This is a common requirement in many apps, to style the form submitting state and give feedback to the user that a click is already being processed.
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters