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.

Form submit firing twice

See original GitHub issue

Hey 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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brunotourinhocommented, Jul 18, 2019

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

1reaction
lubber-decommented, Jul 18, 2019

@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)

Read more comments on GitHub >

github_iconTop 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 >

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