Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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;
}
share|improve this question
1  
There are 3 functions mentioned above but only 2 in the javascript. Are you going to post the script that fixes the issue? –  user10286 Aug 23 '12 at 17:20
    
Shane, please review my edit above and add that function to your fix code. –  Matt Sep 17 '12 at 14:25
    
It worked for me! Thank you a lot! Michael –  user11781 Nov 2 '12 at 12:31
    
Correct me if i'm wrong @Matt, but it doesn't look like there's any difference between the RTE_GetEditorInstanceVariables function you posted here and the OOTB function in form.debug.js –  Nick Larter Jan 2 '13 at 7:51
    
@Nick, Thanks for the input. I did post a caveat there that the function above is in addition to the functions mentioned in the accepted answer and perhaps it is unnecessary. Comparing the OOB version and my version they do look pretty similar. It could be that after defining the other two functions this one needs to be defined again in order to work correctly, but I'm just guessing since it's been 9 months. –  Matt Jan 2 '13 at 16:15
show 3 more comments

3 Answers 3

up vote 3 down vote accepted

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
share|improve this answer
    
please note that even though there's no specific handout of javascript code here, everything you need to create your own solution is provided. –  Matt Sep 17 '12 at 14:32
add comment

@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;
}
share|improve this answer
    
where is RTE_GetEditorInstanceVariables() –  user10228 Aug 22 '12 at 1:15
    
All the functions discussed for the purposes of this question were in form.js in the standard SharePoint js libraries. These are stored in the hive. –  Matt Aug 22 '12 at 16:37
add comment

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?

share|improve this answer
2  
Allow me to answer my own follow-up question...I worked with a talented co-worker today who was able to dig down to the details of this and make it work. Add this to the head of your Masterpage AFTER the call to form.js (if there) or core.js: <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(function () { document.write('<script type="text/javascript" src="/path/to/your/file/location/form.ie9fix.js"></' + 'script>'); }, 'form.js'); </script> This loads your JS file after SharePoint's form.js is loaded. Contents of the JS file below. –  DJ Monzyk Mar 22 '12 at 20:43
    
Sorry, I was vague because, at least in my case, I have several "IE9fix" scripts I need to load. –  Matt Mar 22 '12 at 23:54
add comment

protected by Community Nov 2 '12 at 12:45

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.