disable multiple form submits with vanilla javascript

Solutions on MaxInterview for disable multiple form submits with vanilla javascript by the best coders in the world

showing results for - "disable multiple form submits with vanilla javascript"
Blessing
04 Nov 2016
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);