Udostępnij za pośrednictwem


gazillion spelling errors on blank sharepoint publishing pages

Some publishing page layouts show a gazillion spell check error on just blank pages. After some research it turns out that the User Contact field control will cause a large number of spell check errors just by been on the page.

 

Workaround is to add a piece of javascript to the page in order to tell the spellchecker to ignore the user contact control.

 1. first add a <div id="'excludeContentFromSpellCheck'"> tag around the user contact control

 2. then add the following javascript 

      var a = document.getElementById('excludeContentFromSpellCheck');

      var b = a.getElementsByTagName('input');
       for (var i = 0; i < b.length; i++)

        {
             b[i].setAttribute("excludeFromSpellCheck", "true");   
        }

        var c= a.getElementsByTagName('textarea');
        for (var i = 0; i < c.length; i++)

        {
             c[i].setAttribute("excludeFromSpellCheck", "true");   
        }