Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Disable Multiple Form Submits with Vanilla JavaScript

var form = document.getElementById('formID');
var submitButton = document.getElementById('submitID');

form.addEventListener('submit', function() {

   // Disable the submit button
   submitButton.setAttribute('disabled', 'disabled');

   // Change the "Submit" text
   submitButton.value = 'Please wait...';
			
}, false);
Source by codeblock.co.za #
 
PREVIOUS NEXT
Tagged: #Disable #Multiple #Form #Submits #Vanilla #JavaScript
ADD COMMENT
Topic
Name
7+1 =