Text length in FCKeditor

I am using FCKeditor for the first time. I have it set up but am having trouble passing the user-text into my javascript code. I understand I have to use the FCKeditorAPI, and probably need something like this:var oEditor = FCKeditorAPI.GetInstance('InstanceName') ;
but I am not clear on what the InstanceName is nor how to get the length.

Any help is greatly appreciated.
Who is Participating?
Also,  once you call

var oEditor = FCKeditorAPI.GetInstance('InstanceName') ;

you could say:

var length = oEditor.GetXHTML(true).length;

to get the length of the HTML text...
When you're placing the FCKEditor on a page, you would give it an instance name. This name is what you'd pass to GetInstance. For example:

<script type="text/javascript">
  var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
  oFCKeditor.BasePath = "/FCKeditor/"
  oFCKeditor.Create() ;

For example, this script creates an FCKeditor with the instance name of "FCKeditor1"

This documentation is pretty helpful with the API:
BillthehackAuthor Commented:
Thanks to both of you. I use Oracle Application Express and I do not compose the code myself to create the FCKeditor item. After viewing the source code of the resulting page, I was able to identify the InstanceName and manipulate it through javascript using the length code supplied. I don't quite understand the significance of the syntax GetXHTML(true) but who cares?!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.