I am trying to stop a submit button being pressed more than once. I have tried the following code but it stops the form being submitted at all What I could do with is an “afterclick” event
I should say that it’s usually a more reliable design decision to be capable of withstanding doubleclicks, because many things can interfere with JavaScript running on someones browser.
A typical solution for example is to scan the database for submissions that occur from the same source within 5 seconds of each other, and remove the latter one.
Perhaps an event listener to the on submit call to set the button attribute to disabled? Paul’s solution is more robust and can cause less side effects however.
Sorry didnt see that was suggested, I blame lack of coffee for improper response reading.