prevent double submit with javascript

Solutions on MaxInterview for prevent double submit with javascript by the best coders in the world

showing results for - "prevent double submit with javascript"
Giada
26 Mar 2017
1var form = document.getElementById('formID');
2var submitButton = document.getElementById('submitID');
3
4form.addEventListener('submit', function() {
5
6   // Disable the submit button
7   submitButton.setAttribute('disabled', 'disabled');
8
9   // Change the "Submit" text
10   submitButton.value = 'Please wait...';
11			
12}, false);