?
Solved

Text length in FCKeditor

Posted on 2006-04-01
3
Medium Priority
?
1,039 Views
Last Modified: 2008-01-09
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.
0
Comment
Question by:Billthehack
  • 2
3 Comments
 
LVL 6

Assisted Solution

by:enwhysee
enwhysee earned 500 total points
ID: 16353048
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() ;
</script>

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

This documentation is pretty helpful with the API:
http://wiki.fckeditor.net/
0
 
LVL 6

Accepted Solution

by:
enwhysee earned 500 total points
ID: 16353053
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...
0
 

Author Comment

by:Billthehack
ID: 16355897
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?!

Bill
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question