We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23054
    • 62 Posts
    What is the purpsoe of this function ?
    I saw some code like
    if (edtInstance)
    {   elm = edtInstance.LinkedField;
        if (elm && elm.onchange)
            elm.onchange();
    }
    


    Anyway, I wonder the value of the FCKeditor is often not submitted properly. To go sure in a from I have to focus and unfocus different form elements - very strange.

    So where and how can I get the current value of the FCKeditor?

    Are there some other functions that might be used for different purposes and how ?

    Is there a way to get out the real (visible) edit field of the editor ?
    I want to set the focus on it in case of logical input errors.
      • 4018
      • 1,131 Posts
      The way FCKEditor, TinyMCE, and other online richtext editors work is that they dynamically replace a textarea. For instance, the default content for MODx has a page that allows you to add a blog entry. On that page, a reference to a template variable called ’tvblogContent’ is made. Looking at the source shows a textarea called ’tvblogContent’ and the call for FCKEditor creates a new instance to replace the textarea with something like this:

      new FCKeditor(’tvblogContent’);

      There is no direct way to grab the content of FCKEditor without going through its instance. Instead, you can simply reference the textarea itself. Which brings us to the function you mentioned...

      That particular function is what updates the content of the textarea. Anytime the content of FCKEditor changes, it triggers a function that updates the textarea associated with the FCKEditor instance. The function you listed is part of that function and is necessary to ensure that the textarea is properly updated.

      More details can be found on the FCKEditor website (www.fckeditor.net). Not as much documentation as there probably should be...but there is help available nonetheless. laugh
        Jeff Whitfield

        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."