I have a form where the submit button triggers a function. Let’s call it myFunction(). I need this function to be disabled for 30 seconds after submit but I need the submit button to continue to work. I do not want want to disable the entire button, just the function it triggers. (If the user hits the button again before 30 seconds I need it to submit again, but not execute myFunction a second time.) I’ve tried a million different things but to no avail. I don’t even know which code to post as an example.
<FORM ID="myform">
<INPUT ID="mysubmit" TYPE="SUBMIT" ONCLICK="myFunction();">
</FORM>
What’s the easiest, simplest way to do this using JavaScript?
Did you mean: