I have known good working JS validation functions (validated all the way back to OnClientClick). When called by OnClientClick, they check whether all the required fields have been populated, disable the submit button, and return the correct true/false validation to OnClientClick.
The problem is in disabling the button. The page submits and reloads, but the OnClick event is not fired. Remarking the
document.getElementById("<%=btnSubmit.ClientID %>").disabled = true;
code allows the OnClick event to fire.
I have tried inserting
this.disabled=true;
directly into OnClientClick, as well as using UseSubmitBehavior=false.
Why does the OnClick event not fire when the button is disabled?
OnClick
function will not be executed... – MivawebsetTimeout
to disable the button, as suggested in this post: stackoverflow.com/questions/37955604/…. – ConnorsFan