Question

I had an issue with a number of things due to upgrading my web application's master page to utilize IE9 for HTML 5 and CSS 3 goodies. The problem is this breaks a LOT of things in SharePoint 2010.

One thing in particular was the Rich Text field offered by the Calendar list type for describing an appointment. This field, on the "New" Item form, was completely disabled until a user selected something that reloaded the dialog (like one of the checkboxes).

Below I will provide the solution.

Other issues related to this one I have tackled:

IM Presence icons not working in IE9

Context menus not working in IE9

/**** UPDATE ****/ in response to a comment below I checked the response and noticed there wasn't a block of code for the 3rd function I mentioned. Maybe the solution works without it, maybe not!

Here's my version of RTE_GetEditorInstanceVariables():

function RTE_GetEditorInstanceVariables(strBaseElementID)
{ULS1Lu:;
    if (parent.g_oExtendedRichTextSupport != null) {
        g_oExtendedRichTextSupport = parent.g_oExtendedRichTextSupport
    }
    if (g_oExtendedRichTextSupport != null) {
        if (g_oExtendedRichTextSupport.editors[strBaseElementID] != null) {
            return g_oExtendedRichTextSupport.editors[strBaseElementID];
        }
    }
    return null;
}
Was it helpful?

Solution

Actually, you can set it up so that you can use the Rich Text in IE9 (some people believe you have to disable it completely)! You just have to override 3 functions in form.js (I created a file called form.ie9fix.js) and make sure it loads AFTER the "normal" form.js (or form.debug.js, whichever).

The functions in question:

RTE_DD_GetMenuFrame()
RTE_GetEditorInstanceVariables()
RTE_GetEditorIFrame()

Each of these needs to be rewritten because it makes a call to document.frames() which is not proper notation in pretty much any browser, let alone IE9 (works in IE8-, though!). if you're searching you can find doc.frames( and replace the () with [] and you will be fine, because this is an array reference not a function. You can probably use this to fix the rich text issues in firefox, chrome, etc, as well.

SharePoint has a lot of cases like this and some of them are pretty hard to nail down. This one I had to work even harder because the normal ScriptLink trick did not work. After the main ScriptLink tag on the master page, I added the following for each script where <scriptname> is the name of the script in question.

<script type="text/javascript">
  ExecuteOrDelayUntilScriptLoaded(function(){
     document.write('<script type="text/javascript" src="/_layouts/1033/<scriptname>.ie9fix.js"></'+'script>');
     }, '<scriptname>.js');
/* rinse, repeat, for each script to be overridden */
</script>

Good luck!

  • Matt

OTHER TIPS

@DJ Monzyk

this is a follow up javascript file as reference in previous answer

function RTE_DD_GetMenuFrame()
{
    var ifmMenu=null;
    var elemMenu=RTE_DD_GetMenuElement();
    if (null !=elemMenu)
    {
        if (document.frames.length > 0)
        {
            ifmMenu=document.frames[g_strRTETextEditorPullDownMenuID];
        }
        else
        {
            if ((document.parentWindow !=null) && (document.parentWindow.frames !=null))
            {
                ifmMenu=document.parentWindow.parent.document.frames[g_strRTETextEditorPullDownMenuID];
            }
        }
    }
    if (null==ifmMenu)
    {
        if (g_fRTEFirstCallToGetMenu)
        {
            g_fRTEFirstCallToGetMenu=false;
            return null;
        }
    }
    return ifmMenu;
}

function RTE_GetEditorIFrame(strBaseElementID)
{
    var ifmEditor=null;
    var doc=document;
    if ((null !=doc.frames) && (doc.frames.length==0) && (doc.parentWindow.parent !=null))
    {
        doc=doc.parentWindow.parent.document;
    }
    if ((null !=doc.frames) && (doc.frames.length > 0))
    {
        var ifmContainer=doc.getElementById(RTE_GetEditorIFrameID(strBaseElementID));
        if (ifmContainer !=null)
        {
            ifmEditor=doc.frames[RTE_GetEditorIFrameID(strBaseElementID)];
        }
    }
    return ifmEditor;
}

Its great that you seem to have a solution for this, as I've encountered this maddening problem and am desperately trying to remedy it. You allude to the fix, but I'm still not clear on the "HOW" aspect of it.....You identified the functions in question, and how to call the script once its ready, but I dont get the "Each of these needs to be rewritten" part...in what way? Do you have a script you can share?

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top