I am facing more or less the same problem described here, (i.e. I have a submit input which is clicked programmatically when it gains focus after a tab, but the focus handler is also invoked when the user clicks on the button, causing a double submit). The solution suggested in the linked post works, but I need one which does not require jQuery. Does anyone have some thoughts on that? Please note that I need the button’s click behavior to remain the same, as it is binded to an asp .net server-side event. Thank you!
Share
You’ll want to prevent the form from submitting so add an event listener and then code how you want JavaScript to handle submitting the form. Also +1 to your question for asking how to competently code this without depending on any frameworks! 🙂
Some rough code to give you an idea of how to prevent a form from submitting…