There were two different methods proposed for accomplishing the prevention of the double click. The first one being to put the code into the submit button:
The second was to apply changes to the form onsubmit. The second method would change the onsubmit function so that if it is clicked on the second time it would alert a message instead of submitting the form. You can change the message to something more fitting to your form, like "Please do not double click the submit button".
These both look like valid solutions to this issue.