So I've been blocking the page with a "Loading" message using the following code for a logon page
<input id="submit" type="submit" value="Log On" onclick="block();"/>
If there's an error with the validation though, the block message will stay there forever. What's the best way to present the block message so it takes the validation into account?
If the validation is being triggered automatically and stopping the form from posting, I would simply move the
block();
call to the forms onsubmit attribute:This way, it will only trigger when the form submits, rather than when the user clicks the button when the form may be invalid.