question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent simultaneous submission of multiple forms

See original GitHub issue

Bug, Feature, or Question?

Feature/Question

Current Behavior

When there are two HTML forms present a submission will attempt to submit both forms. This causes validation to run on both even if it was desired to only submit one.

Desired Behavior

Only the target of the even should be submitted.

Suggested Solutions

This can be implemented in userland but it would be awesome if passing an id or name to the form element would prevent multiple form submission from happening. Formik could look at event.target.name or event.target.id and only call this.executeSubmit if if matches the element. EDIT: It can also be implemented using refs so that the user doesn’t have to provide an id or name.


  • Formik Version: v0.11.10
  • React Version: v16.2.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
miguelollercommented, Mar 16, 2018

@prichodko,

Yes, that was clear!

Let’s close it then?

Yup. Thanks for all your help fellas.

0reactions
prichodkocommented, Mar 15, 2018

@migueloller sorry if I wasn’t clear enough - it was what I meant by prevent the event from bubbling up.

Let’s close it then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent form from submitting multiple times from client ...
Use unobtrusive javascript to disable the submit event on the form after it has already been submitted. Here is an example using jQuery....
Read more >
Prevent simultaneous submission of multiple forms #135
How can I prevent simultaneous submission of two forms? In my particular case I have login + reset password forms (in a modal...
Read more >
How can I prevent multiple form submissions? - Jotform
How can I prevent multiple form submissions? · Use cookies (loose check) or IP address (strict check) to prevent multiple form submissions. ·...
Read more >
How to disable multiple form submit (POST) in IIS - Server Fault
You would have to find a way to block more than 'x' connections from one IP address. Where x is greater than the...
Read more >
Stopping Multiple Form Submission. - Laracasts
The most straight forward way to guarantee the uniqueness of a form submission (In the sense of stopping someone mashing submit twice) is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found