JavaScript error while entering text in the Content Editor Web Part

,

While working on a project for one of our customers, we have stumbled on a quite odd error. While editing text in the Content Editor Web Part (CEWP) we got a JavaScript error on each key press.

As we have customized the SharePoint Rich Text Editor (RTE) by adding additional buttons and assets, I suspected our own extensions to be the reason of the error at first. Unfortunately, after removing the customization, the error persisted.

The error itself was quite odd: we got it while using the Content Editor Web Part only. While editing content using exactly the same RTE as a Rich HTML control there was no error. Furthermore, we received the error in the test environment only. Our development machines didn't show up any error at all!

After debugging the RTE2PUEditor.aspx page – the asset responsible of creating the instance of the RTE editor for the CEWP I have found out that it references multiple JavaScript files. After comparing these files to the one from our dev machines, I have found out that one of them – LAYOUTS\1033\BFORM.JS was different. After replacing it with the one from our development environment, the JavaScript error disappeared.

Looking at the reason of the error and the differences between the bform.js files we have found out that it has to have something to do with different SharePoint installs we we using. While we still use the updated RTM on our development machines, we have used the slipstreamed SP1 version of SharePoint on the test environment.

Update April 16, 2008:

Replacing the BFORM.JS only doesn't solve the whole issue. While editing the content using the RTE in the Edit Form, SharePoint keeps throwing the error on each key press. In order to fix it, you have to replace the LAYOUTS\1033\FORM.JS as well.


Possibly related posts

16 Responses to “JavaScript error while entering text in the Content Editor Web Part”

  1. anonymous Says:

    Make sure to first install WSS SP1 and afterwards MOSS SP1!!! (see http://technet.microsoft.com/en-us/office/sharepointserver/bb735839.aspx)

  2. Stan Says:

    Were you actually able to replace the Rich Text Editor used with the Content Editor Web Part? We are trying to accomplish the same thing and having some difficulty figuring out how to get a 3rd part RTE to pop up when we edit a CEWP. Any tips?

    thx!

  3. Waldek Mastykarz Says:

    When using for example the Telerik RadEditor, you'll notice, that it's using a slightly different editing experience. Telerik uses in-place editing while the OOTB RTE uses a pop-up. Sometime in Q3 there will be another RTE available for SharePoint 2007 – the aRTE (Accessible RTE) provided by HiSoftware. I'm really curious about the editing experience it will provide and how it will integrate in SharePoint.
    As for now: do you really need to replace the OOTB RTE rather than using for example the Telerik RadEditor Lite?

  4. Manh Le Says:

    Thank you very much for posting this issue. My Content Editor Webpart is now working!

  5. Sivaraj Says:

    Thanks for posting this.

    In addition to the BFORM.JS I have to copy over the OWS.JS file also from a working environment to get this issue fixed.

  6. Waldek Mastykarz Says:

    Thanks for the update Sivaraj. I haven't experienced that myself, but then again: it might depend on the configuration of your server.

  7. Rik Says:

    We ran into this very same issue after upgrading to moss2007 SP1, and have the impression this could very well be because of not having installed WSS Language packs.

    To fix the issue we simply did a bit-by-bit comparison of two files for each languagepack ( compared to the English files, who didn't have the error ) – ignoring language differences ofcourse.

    * FORMS.js
    * BFORMS.js

    No other files where modified so far, and we no longer receive the errors.

  8. Fouad Says:

    Hey,
    Am facing the same problem of ur\'s, I\'ve installed the infrastrcture updates [infrastructureupdateformicrosoftofficeservers-kb951297-fullfile-x86.exe & infrastructureupdateforwindowssharepointservices3.0-kb951695-fullfile-x86.exe] and the error started to pop-up.

    I've tried to replace the Forms.js,BForms.js,and also OWS.js but the error is still popping on each key press!

    Is there anything else which can be done?
    I appretiate any help ASAP.

    Thanks,
    Fouad

  9. Deva Says:

    Fouad the Service pack 2 is release and it will be helpful if you install the Service pack 2 and then see if you still get the error.

    http://www.ekhichdi.com/sharepoint-blogs/wss-3-0-and-office-server-service-pack-2

  10. alexey Says:

    Tried SP2 installation, didn\\\'t help either.. same error on key press in rte.. I wouldnt really like to modify moss system js though

  11. Waldek Mastykarz Says:

    @alexey: While I understand your point of view, so far I heavent heard of any other solution to this issue.

  12. Gunnar Peipman Says:

    Hi Waldek!

    What do you think about switching from SharePoint default HTML editor to some other editor (Telerik, TinyMCE, or something like that)? It shouldn't be technically complex.

  13. Waldek Mastykarz Says:

    @Gunnar Peipman: while it's definitely possible and something I've done a couple of times myself, it all depends on the requirements. Some customers might just want to stick to the default RTE.

  14. mdarwish Says:

    thanks Waldek,
    it's working fine now, we have to delete all temporary files and cookies used in IE after replacing the files.

  15. Waldek Mastykarz Says:

    @mdarwish: thanks for getting back on it. Great to hear it's working.

  16. Arjita Says:

    Well..I dnt even have .js files at that path?But its still giving an error :

    Invalid argument: \layouts\1033\html.js

Leave a Reply

Security Code:

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS
Copyright © 2007 - 2012 Waldek Mastykarz

Creative Commons License