none
InfoPath form page: Object doesn't support this property or method addeventlistener in IE 11

    Question

  • I am getting error: Critical Error: Object doesn't support this property or method addeventlistener, while accessing the InfoPath form page in IE 11 browser. This error is specific to IE 11, the page is opening properly in IE 10 and below. According to http://msdn.microsoft.com/en-us/library/ie/bg182625%28v=vs.85%29.aspx IE 11 supports addEventListener.

    Anybody having idea on this?

    Thanks.


    • Edited by SuPar Monday, September 16, 2013 1:15 PM added reference link
    Monday, September 16, 2013 10:01 AM

Answers

  • not that im aware of, you may be able to use a GP (group policy) to update the browser settings for all users.

    Regards

    Sergio Giusti
    http://sergioblogs.blog.co.uk/

    Whenever you see a reply and if you think is helpful, click " Alternate Text Vote As Helpful". And whenever you see a reply being an answer to the question of the thread, click " Alternate Text Mark As Answer".

    Tuesday, September 17, 2013 8:49 AM

All replies

  • Have you tried running in compatability mode (press F12 and change the Browser Mode)?

    Regards

    Sergio Giusti
    http://sergioblogs.blog.co.uk/

    Whenever you see a reply and if you think is helpful, click " Alternate Text Vote As Helpful". And whenever you see a reply being an answer to the question of the thread, click " Alternate Text Mark As Answer".

    Monday, September 16, 2013 3:02 PM
  • Hi Sergio,

    Yes, I tried running it in compatibility mode and yes there is no error in comp. mode. What could be the possible fix for this in normal mode?

    Thanks.

    Tuesday, September 17, 2013 4:47 AM
  • Hi Supar

    there isn't a fix, this is not an error, its by deign, its the way the browser renders for the new HTML standards it does not include certain aspects in the header which SharePoint looks for, you need to change the browser mode to be in compatibility view or it wont work.


    Regards

    Sergio Giusti
    http://sergioblogs.blog.co.uk/

    Whenever you see a reply and if you think is helpful, click " Alternate Text Vote As Helpful". And whenever you see a reply being an answer to the question of the thread, click " Alternate Text Mark As Answer".

    Tuesday, September 17, 2013 7:23 AM
  • Thanks Sergio. But the problem is the InfoPath form doesn't get loaded on the page. I just see the error dialog. Any possible workaround than changing mode? Because I can not ask everybody to change the mode.

    Tuesday, September 17, 2013 8:09 AM
  • not that im aware of, you may be able to use a GP (group policy) to update the browser settings for all users.

    Regards

    Sergio Giusti
    http://sergioblogs.blog.co.uk/

    Whenever you see a reply and if you think is helpful, click " Alternate Text Vote As Helpful". And whenever you see a reply being an answer to the question of the thread, click " Alternate Text Mark As Answer".

    Tuesday, September 17, 2013 8:49 AM
  • Ok. Thanks. I will check if it is feasible as per your suggestion.
    • Proposed as answer by Shane Gib Friday, December 06, 2013 8:19 PM
    • Unproposed as answer by Shane Gib Friday, December 06, 2013 8:19 PM
    Tuesday, September 17, 2013 10:54 AM
    • In the top right hand corner of the IE 11 Browser there is a settings menu that can be identified by looking like a flower or car gear in shape, click this icon
    • Next under the contextual fly-out menu click on “Compatibility View settings”
    • Next On the pop-up menu there are 5 steps to setting up your IE 11 Browser to be compatible with the SharePoint site they are as follows:

    Step 1:

    1. Check the checkbox next to “Display intranet sites in Compatibility View”
    2. Check the checkbox next to “Use Microsoft compatibility lists”

    Step 2:

                    Verify that your domain is listed in the textbox below the label “Add this website:”

    Step 3:

                    Click the “Add” button to the right of the textbox with your domain in it

    Step 4:

    Verify that your domain is now listed in the list box below the label “Websites you’ve added to Compatibility View:”

    Step 5:

                    Click the “Close” button to the bottom right of the pop-up window

    It is recommended that you restart your browser session by closing (All browser windows) and re-open your IE 11 Browser window, you should now see the site in Compatibility Mode with no issues.

    • Proposed as answer by Shane Gib Friday, December 06, 2013 8:21 PM
    Friday, December 06, 2013 8:21 PM
  • I would communicate in one form or another to your users that this step must be performed for them to use your site properly and without issues whether it be via email, pop screen etc.
    Friday, December 06, 2013 8:29 PM
  • I experienced the same issue with OOTB workflows for publishing pages.

    My opinion is pretty bleak to say the least. It seems every time the team at Microsoft releases an update to IE it breaks more things than it improves. Default options of a simple IE11 install with no governing IE policies should not break OOTB, default publishing page workflows in SharePoint 2010 (didn't go back to 2007 to test). Also the error message isn't 100% correct, as the browser does support addEventListener. It is supported in IE and has been since version 9.

    To complicate the issue though - does your master page have an X-UA-Compatible tag and is set to IE8?

    In IE11 - with IE8 mode set - the workflow fails. The error is just as your described. (Screenshot below)

    In IE11 - running in any other mode (9, 10, Edge) - the workflow form runs smoothly.

    I urge you to do this test on your own InfoPath form. Go to the form using IE Edge mode, see if it's working. Change to 10, change to 9, is it still working? Hit 8 and it errors out? Even though in IE10 - using IE8 mode - the form works just fine. Something about IE11 in 8 mode fudges things up.

    Fact of the matter is the error, though not intelligent, does identify the issue. IE8 never supported addEventListener. So something in OOTB SharePoint 2010 needs to be updated to properly test for attachEvent or addEventListener and use the right one.

    Friday, December 13, 2013 3:27 PM
  • In this scenario it doesn't work
    IE11 is using IE8 mode

    On the page you'll find values defined for UserAgentInfo.strBrowser, for IE11 it is set to 3.

    UserAgentInfo.strBrowser = 3;
    UserAgentInfo.strBrowserType = 8;
    UserAgentInfo.intBrowserRmj = 11;

    There is an accurance of addEventListener in the Window.AttachEventHandlers function (Core.js):

    if(UserAgentInfo.strBrowser==3)a.addEventListener("resize",Window.OnResize,false);


    In this scenario it does work
    IE10 is using IE8 mode

    UserAgentInfo.strBrowser = 1;
    UserAgentInfo.strBrowserType = 6;
    UserAgentInfo.intBrowserRmj = 8;

    So addEventListener is never called.

    Browser detection is obviously a bad technique, especially when playing around with IE and it's compatibility modes. The best practice is testing if a method exists before proceeding - the route I'll assume for now Microsoft did not take.

    Friday, December 13, 2013 4:07 PM
  • Obviously editing core files is not recommended by Microsoft, and this hacky solution I came up with isn't recommended by me - but it fixed the problem. I don't have to force users to use compatibility mode just to work with simple workflows and all I did was add this to the core.js file:

    /* begin IE11 fix */
    if (!window.addEventListener) {UserAgentInfo.strBrowser=1}
    /* end IE11 fix */

    At the beginning of the Window.AttachEventHandlers function.

    The Core.js file is located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\INC.

    http://markadrake.com/examples/sharepoint/ie11-fix-core-js/Core.js

    I strongly recommend making a backup of your current Core.js file before replacing with mine. Please comment back and let me know if it takes care of the issue.

    Update: I strongly discourage updating core files. The following JS code added to the bottom of my master page before the closing <body> tag fixed it.

    http://markadrake.com/examples/sharepoint/ie11-fix/

    <script language="javascript">
    /* IE11 Fix for SP2010 */
    if (typeof UserAgentInfo.strBrowser !== 'undefined' && !window.addEventListener) {
    UserAgentInfo.strBrowser=1; } </script>

    • Proposed as answer by Mark Drake Friday, December 13, 2013 4:43 PM
    • Edited by Mark Drake Friday, December 13, 2013 5:09 PM Don't recommend editing Core.js file in the hive
    Friday, December 13, 2013 4:42 PM
  • Thanks Markus.  I tried your fix and it seemed to work.  I had to clean the UserAgentInfo != undefined test a bit but this is what I added to the bottom of my master page.  

    <script language="javascript">
    /* IE11 Fix for SP2010 */
    if (typeof(UserAgentInfo) != 'undefined' && !window.addEventListener) {
    UserAgentInfo.strBrowser=1; } 
    </script>

    Thanks so much!

    Jonathan

    Wednesday, December 18, 2013 7:31 PM
  • The problem is the local Intranet security settings in the browser.   I was able to fix the problem by repopulating the local intranet sites.  Apparently, when you upgrade from IE 10 to IE 11 all of the settings don't populate correctly.  Please follow these steps:

    1. Open Internet Explorer
    2. Click on Tools at the top and select Internet Options
    3. Click the Security Tab
    4. Click Local Intranet
    5. Click Sites
    6. Click Advanced and all of the intranet sites will reappear in the websites box, make sure there is a check box in the Require server verification box
    7. Click Close
    8. Click Ok
    9. Click Ok and you’re done
    10. Then, try accessing the form again.
    • Proposed as answer by vingn_it Tuesday, January 21, 2014 8:40 PM
    Tuesday, January 21, 2014 7:01 PM
  • The problem is the local Intranet security settings in the browser.   I was able to fix the problem by repopulating the local intranet sites.  Apparently, when you upgrade from IE 10 to IE 11 all of the settings don't populate correctly.  Please follow these steps:

    1. Open Internet Explorer
    2. Click on Tools at the top and select Internet Options
    3. Click the Security Tab
    4. Click Local Intranet
    5. Click Sites
    6. Click Advanced and all of the intranet sites will reappear in the websites box, make sure there is a check box in the Require server verification box
    7. Click Close
    8. Click Ok
    9. Click Ok and you’re done
    10. Then, try accessing the form again.
    • Proposed as answer by vingn_it Tuesday, January 21, 2014 8:39 PM
    Tuesday, January 21, 2014 7:02 PM
  • Thanks KJefferson! The solution worked out perfectly.

    The problem is the local Intranet security settings in the browser.   I was able to fix the problem by repopulating the local intranet sites.  Apparently, when you upgrade from IE 10 to IE 11 all of the settings don't populate correctly.  Please follow these steps:

    1. Open Internet Explorer
    2. Click on Tools at the top and select Internet Options
    3. Click the Security Tab
    4. Click Local Intranet
    5. Click Sites
    6. Click Advanced and all of the intranet sites will reappear in the websites box, make sure there is a check box in the Require server verification box
    7. Click Close
    8. Click Ok
    9. Click Ok and you’re done
    10. Then, try accessing the form again.

    Tuesday, January 21, 2014 8:45 PM
  • thank you. I did exactly you said In the master page(v4.master) using SharePoint designer. It is not working. I am not able to see the script in F12. Please help me.

    Add the following code before the closing <body> tag in your master page to resolve issues with Sharepoint 2010 workflows and IE11 using IE8 mode.

    <script language="javascript">
    /* IE11 Fix for SP2010 */
    if (typeof UserAgentInfo.strBrowser !== 'undefined' && !window.addEventListener) {
    UserAgentInfo.strBrowser=1; } </script>

    I added the code to the source of the document in case you are having issues copying from above.

    Thursday, January 23, 2014 12:27 AM
  • This solution worked perfectly and can be pushed out as a group policy for our local users.

    It can be presented to our remote users from out help Desk when contacted.  It is easy and is non-invasive, nothing to add to the files at all.   Love it!




    • Edited by CrjangelFG Friday, January 24, 2014 1:05 PM
    Friday, January 24, 2014 1:05 PM
  • I am facing a similar kind of issue. But I am not using SharePoint. It is a simple web application where I have an Update button. When I click on Update a JQuery popup appears and user can update its details. But Nothing happened when I click on submit button. It is working fine in IE10.

    When I tried to debug using F12, I could see that I am getting "Object doesn't support this propert or method "attachEvent".

    I tried using the above solution but I don't have any master page used in the application. So I added above code to the page from where popup is called and it did not work.

    Can anyone point me to the right direction as I need to fix this issue as soon as possible.

    Regards

    RK

    Tuesday, April 29, 2014 1:47 AM
  • Step 2 has fixed my issues. thanks Shane.

    Wednesday, August 20, 2014 5:56 PM