disable form submit javascript code example
Example 1: js stop form submit
<button type="submit" onclick="submitButtonClick(event)">Submit</button>
<script>
function submitButtonClick(event) {
event.preventDefault();
}
</script>
Example 2: javascript prevent form submit
<form name="foo" onsubmit="return false">
Example 3: Disable Multiple Form Submits with Vanilla JavaScript
var form = document.getElementById('formID');
var submitButton = document.getElementById('submitID');
form.addEventListener('submit', function() {
submitButton.setAttribute('disabled', 'disabled');
submitButton.value = 'Please wait...';
}, false);