JQuery Unobtrusive Validation in IE 7 Compatibility Mode causes "Member Not Found" Error in Page with Form

StackOverflow https://stackoverflow.com/questions/16013134

  •  04-04-2022
  •  | 
  •  

Question

Recently I noticed a JQuery error when viewing my site in Internet Explorer. The error is a "Member not found" error originating from the JQuery source. I noticed that the compatibility mode button was clicked-unclicking this fixed the error but I can't assume users of my site will be so obliging. Since then I have tested my site using the different compatibility modes and cannot seem to shake-off this error.

To re-create the error I trimmed a test page to the following

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=IE7">
        <script src="/content/scripts/jquery-1.9.1.js"></script>
        <script src="/content/scripts/jquery.validate.js"></script>
        <script src="/content/scripts/jquery.validate.unobtrusive.js"></script>
        <title>IE Compatibility Test</title>
    </head>
    <body>
        <form>
        </form>
    </body>
</html>

Note: I am using JQuery Validation version 1.11.1 and Microsoft JQuery Unobtrusive Validation version 2.0. When the page loads the "Member not found" error occurs. I've noticed that removing the form tag stops the error from occuring. I've also tried providing the form with a name and id but the error still occurs.

I have searched for this others experiencing this error but found nothing relevant. This leads me to believe that I am doing something wrong. I would like to get this problem fixed as I am concerned that a user of my site will select "Compatibility View" in IE and the site won't operate correctly.

What is it I am missing/has anyone else experienced this error?

Was it helpful?

Solution

Are you using IE 10? If yes then changing to compatibility mode to IE 7 or 8 is a bug.

Please refer to JQuery Unobtrusive Validation Bug ticket # 12577

Use the following meta to ensure the latest rendering engine is used

<meta http-equiv="X-UA-Compatible" content="IE=edge">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top