locked
Transforming textarea into rich text editor RRS feed

  • Question

  • According to this blog:

    http://adrian-alexan.blogspot.com/2009/12/html-wysiwyg-editors-in-crm-forms-non.html

     

    you can turn an ntext field on a CRM form into a rich text editor.

     

    We're trying to get this working using the openWYSIWYG editor that is mentioned in the blog, but we haven't been able to get it right yet.

    The necessary script file is loaded with this code: (the blog says modify the global.js file, but we don't want to do that)

     

     

    var
     script = document.createElement('script'
    );
        script.language = 'javascript'
    ;
        script.src = file; // path to js file, eg. "/isv/script.js"
    
            script.onreadystatechange = function
     ()
            {
                if
     (event.srcElement.readyState == "complete"
     ||
              event.srcElement.readyState == "loaded"
    )
                    formIsReady();
            };
       
        document.getElementsByTagName('head'
    )[0].appendChild(script);
    

    We do get the editor attached to a textarea on a CRM form, but when you try to save to form, there is a script error that says: <Message>Could not complete the operation due to error 80020101.</Message>

     

     

    Friday, January 15, 2010 10:57 AM

Answers

  • Try ti use it:

    var script = document.createElement("script");
    script.language = "javascript";
    script.src = "http://mycrm:5555/ISV/script.js";
    document.getElementsByTagName('head')[0].appendChild(script);

    var f = function()
    {
    try
    {

    formIsReady();

    }
    catch(ex)
    {
    }
    }
    script.attachEvent("onreadystatechange", f);


    Jimmy Larrauri http://jimmylarrauri.blogspot.com
    Friday, January 15, 2010 3:21 PM
    Moderator