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);