I am new to javascript, but must make a mod to a slow running RPGILE program (mainframe language). I tried the below code, but the form doesn't submit until I respond to the alert box.
<input type="submit" name="Continue" value="Send this order " onClick="alert('Please Wait...')" >
An alert box will pause everything else until it's dismissed.
As a quick alternative, you could hide the button on click and show the 'Please wait...' message in its place.
Try replacing your input with this:
<div>
<input type="submit" name="Continue" id="sendButton" value="Send this order">
<div id="loadingMessage" style="display: none;">Please wait...</div>
</div>
<script>
document.getElementById('sendButton').addEventListener('click', () => {
document.getElementById('sendButton').style.display = 'none';
document.getElementById('loadingMessage').style.display = 'block'
});
</script>