javascript - HtmlButton not running client side validation in IE11 -
i having odd issue web form using htmlbutton in asp.net. formatting reasons need use <button> construct fine, works in every other browser tested ie11.
<button id="cmdlogin" runat="server" onserverclick="cmdlogin_onserverclick" class="btn btn-more" validationgroup="login" causesvalidation="true"> login </button> when place standard asp.net button control, works, client side validation run. difference can see between buttons onclick function asp.net injects:
if (typeof(page_clientvalidate) == 'function') page_clientvalidate('modallogin'); __dopostback('ctl00$scriptsfooterplaceholder$tdf971800010$cmdlogin','') i know ie11 had issues __dopostback .net 4 on .net 4.51, don't think that. there no javascript errors can see stop (and standard button test guess client side script working) , in every other browser have tested (chrome, ff, safari, ie8, ie9, ie10) working, ie11.
anyone seen sort of issue?
i thought try , hijack click event in ie11 , see if manually force validation. turned out easier going through process code below, "fixes" ie11 issue:
<script> var isie11 = !!navigator.useragent.match(/trident.*rv\:11\./); if (isie11) { $('.btn').on('click', function (e) { e.preventdefault(); }); } the preventdefault it, odd allows client side validation work expected, i.e. gets caught without forcing postback (before client side stuff ignored , forms validated on postback), "fix" not stopping client side validation working.
note: not or advocate sniffing browser , version, in case ie11 has behavior , going more research after project out door. seems bug in ie11 .net , using htmlbutton construct may need patch microsoft.
Comments
Post a Comment