0

In my ASP.Net app with framwork 3.5, I am looping Page_Validators and apply css style to required fields but I does not work in ipad iOS 8 Safari 8

for (var i = 0; i < Page_Validators.length; i++) {
    var val = Page_Validators[i];
    var ctrl = document.getElementById(val.controltovalidate);
    if (ctrl != null && ctrl.style != null) {
        if (!CheckValidatorsForControl(ctrl))
            ctrl.className = "ValidationOn";
        else
            ctrl.className = "";
    }
}

Even if I try a basic javascript alert like below: alert(Page_Validators.length);

Nothing happen in in ipad iOS 8 Safari 8. For all other browsers, everything is perfect.

Thanks in advance for any help.

  • When I view source, there is a lot of things missing e.g.
    – Marty Webb Oct 22 '14 at 13:53
  • Add the following code in the web.config file in the system.web section will fix the problem EcmaScriptVersion = 1.4 w3cdomversion = 1.0 supportsCallback = true EcmaScriptVersion = 1.4 w3cdomversion = 1.0 supportsCallback = true – Marty Webb Oct 22 '14 at 18:29

1 Answers1

0

I had a similar issue, the fix provided by Marty Webb in his comment worked for me. Basically, .NET wasn't addding validation on my iOS browsers. This update to the Web.Config seems to fix it for me.

Update Web.config in the system.web section

    <browserCaps> 
       <filter> 
          <case match="AppleWebKit/6\d\d"> EcmaScriptVersion = 1.4 w3cdomversion = 1.0 supportsCallback = true </case> 
          <case match="AppleWebKit/85\d"> EcmaScriptVersion = 1.4 w3cdomversion = 1.0 supportsCallback = true </case>
       </filter> 
    </browserCaps>
uffa
  • 501
  • 5
  • 5