javascript - Button event isn't firing after disabling the button in IE9 and IE8 -
i have submit button on page. on client click of submit button i'm using following javascript function:
function submitdisable() { var valid = page_clientvalidate(); if (valid) { document.getelementbyid("btnsubmit").style.cursor = "wait"; document.getelementbyid("btnsubmit").disabled = true; document.getelementbyid("btnsubmit").innertext = "submitting..."; } else { submitenable(); approveenable(); } }
it working fine in ie10
, chrome
, aurora
not working in ie9
, ie8
.
whenever click on submit button
gray out button
, change text submitting , page
hangs out. doesn't submit
page
.
how can resolve issue
in ie9
, ie8
? looking forward replies.
sounds doing asp.net require call necessary dopostback
after button has been disabled:
server-side implementation:
protected void page_load(object o, eventargs e) { btnsubmit.attributes.add("onclick", "submitdisable();" + page.clientscript.getpostbackeventreference(btnsubmit, "").tostring()); }
or
client-side implementation:
function submitdisable() { var valid = page_clientvalidate(); if (valid) { document.getelementbyid("btnsubmit").style.cursor = "wait"; document.getelementbyid("btnsubmit").disabled = true; document.getelementbyid("btnsubmit").innertext = "submitting..."; <%=page.clientscript.getpostbackeventreference(btnsubmit, "").tostring()%> } else { submitenable(); approveenable(); } }
essentially add following code function:
__dopostback('mypanel$btnsubmit','');
after disabling button, forcing .net postback required control.
Comments
Post a Comment