Form submit firing twice
See original GitHub issueHey guys!
I’m having a problem, but it’s not quite consistent.
Whenever I click on a submit button inside a form:
<form asp-action="Login" asp-controller="Login" method="post" class="ui large form" asp-antiforgery="true">
…
<input type="submit" value="Enter" class="ui fluid large submit button" />
Sometimes it fires the form once as expected but sometimes it fires twice.
I’m in a Asp.NET Core environment
I’m pulling my hair out, It’s causing duplication inserts on my application.
Any help would be appreciated.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Form gets submitted twice on button click - Stack Overflow
The problem is form gets submitted twice when I enter something in ref_no texbox and form submitss once for the rest of textboxes....
Read more >Form submitted twice with one click - Go Forum
I am having an issue with a form submitting twice on a single click. I have removed all of the other code from...
Read more >Javascript: prevent double form submission - The Art of Web
A quick double-click on a button or link can have unintended consequences, such as a form being submitted twice, or a script running...
Read more >Solved: Re: Submit button firing twice - Shopify Community
Re: Submit button firing twice ... Actual issue is the code you are using is buggy. You are using onclick on button somehow...
Read more >97085 - form is submitted twice when using onClick and submit
Reproducible: Always Steps to Reproduce: 1.Create a FORM with a submit button that calls a JavaScript function with onClick="function_name()" 2. Create a simple ......
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
Thank you so much @lubber-de for your time.
I’m gonna check for JS leaks in my code. I use some injected partial views, maybe I’ll find the reason.
BEST FRAMEWORK EVER
@brunotourinho Regarding the “keyboardShortcuts:false should prevent Enter-key submit”: This seems to be a default behavior (tried in chrome/edge) in current browsers, because actually the code which is monitoring keyboard entries is indeed not initialized by FUI when
keyboardShortcuts:false
, thus it is also not checking if the enter key is pressed to prevent submitting the form. I suggest to create a separate issue for that, because i think we have to implement a new setting just to prevent Enter for form submission and make use of the keyboard event routine all the time (to check for enterkey to prevent default behavior)