I am trying to enable a button once the form is submitted.
I can enable the button but I want to wait for the form to complete the process and then enable the button. I can wait for a few sec using setTimeout()
and then enable the button but I don't want that. I want once the form has completed it's process then enable the button. I am not sure if this is a possible use case.
Form:
<input type=submit id="myButton" class="esignReports" value="Export E-Sign Information" onclick="disableReportButton(), enableReportButton()"/>
JS:
function disableReportButton() {
document.getElementById('viewIntegrationReport').submit();
document.getElementById('myButton').disabled = true;
document.getElementById('myButton').value = 'Please wait';
}
function enableReportButton() {
document.getElementById('myButton').disabled = false;
document.getElementById('myButton').value = 'Export E-Sign Information';
}
Thanks.