I want to disable the submit button after pressing it using javascript.
myForm.onsubmit = function () {... mySubmitButton.disabled = true; ...}
But when the user stops opening a new page while the current is still alive, the button remains disabled.
The same result will be if the content from the server is a file (in this case, there will be no redirection to a new page).
Is there a way to determine if the browser wants to "download" a new URL and enable mySubmitButton again?
source
share