Multiple Submit Buttons?
See original GitHub issueHello Formsy React/Christian,
Can we do the following:
<button type="submit" name="save" value="save-and-continue" className="btn btn-default save-and-continue" disabled={!this.state.canSubmit}>
{loadingIcon}
Save & Continue
</button>
<button type="submit" name="save" value="save-and-add" className="btn btn-default save-and-add" disabled={!this.state.canSubmit}>
{loadingIcon}
Save & Add Another
</button>
<button type="submit" name="save" value="save-and-return" className="btn btn-primary save-and-return" disabled={!this.state.canSubmit}>
{loadingIcon}
Save & Return to List
</button>
Only the value that was clicked would be passed through in the model onSubmit so if the second button above was clicked we’d get {save: ‘save-and-add’} in our form data?
What do you think? Useful?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Two submit buttons in one form - Stack Overflow
The best way to deal with multiple submit buttons is using a switch case in the server script <form action="demo_form.php" method="get"> ...
Read more >How to use multiple submit buttons in an HTML form
How to use multiple submit buttons in an HTML form ? · Create a form with method 'post' and set the value of...
Read more >Using Multiple Submit Buttons With A Single Form
Using Multiple Submit Buttons With A Single Form · Option 1 – Buttons With Same Name, Different Text · Option 2 – Different...
Read more >How can I use multiple submit buttons in an HTML form?
yes, multiple submit buttons can include in the html form. One simple example is given below. Here I am using MVC VB.net.In view...
Read more >Separate Form Submit Buttons That Go To Different URLs
When you submit that form, it's going to go to the URL `/submit`. Say you need another submit button that submits to a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi there!
You can solve this by manually submitting the form 😃
Quick example:
Would that work for you?
@christianalfoni But now you don’t have a submit button, so you can’t submit on press enter key?