Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Prevent Double Submit with 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);
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to remove empty spaces befiore string js 
Javascript :: javascript multiply array with scalar 
Javascript :: express-ejs-layouts install 
Javascript :: convert elements to array javascript 
Javascript :: JavaScript HTML DOM - Changing CSS 
Javascript :: js loop through array backwards with foreach 
Javascript :: javascript sort array by index 
Javascript :: create react portal 
Javascript :: javascript add 1 day to new date 
Javascript :: how to limit input type max length 
Javascript :: select2 find option by value 
Javascript :: reactive forms change event in angular 
Javascript :: output in javascript 
Javascript :: viewchild for ngfor 
Javascript :: react addeventlistener useeffect 
Javascript :: convert node.js to ES6 
Javascript :: react native copy to clipboard 
Javascript :: jquery today date 
Javascript :: javascript sort array of objects by key value 
Javascript :: discord.js button 
Javascript :: chartjs min 
Javascript :: nodejs aws s3 stream upload 
Javascript :: submit a form on enter angular 
Javascript :: javascript absolute path 
Javascript :: get object key from value javascript 
Javascript :: expo react native 
Javascript :: example of pre increment in js 
Javascript :: javascript class inheritance 
Javascript :: json multiple records 
Javascript :: javascript js isNumber 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =