I have a submit button at the end of the form.
I have added the following condition to the submit button:
onClick=\"this.disabled=true; this.value=\'
function xxxx() { // submit or validate here , disable after that using below document.getElementById('buttonId').disabled = 'disabled'; document.getElementById('buttonId').disabled = ''; }