<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/fckeditor/' ;
//set the EnterMode to "br" (overwrites the default configuration from fckconfig.js)
$oFCKeditor->Config['EnterMode'] = 'br';
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
$oFCKeditor->Create() ;
?>
Mon, 09/28/2009 - 20:55
#1
Re: Javascript to check if anything is entered in editor
then execute this function before e.g.:
Re: Javascript to check if anything is entered in editor
but how does the function FCKCopy() works actually?
Re: Javascript to check if anything is entered in editor
Re: Javascript to check if anything is entered in editor
Re: Javascript to check if anything is entered in editor
Wow -- this works great.
Is there a way to return focus to the validated field? I tried:
But focus was not shifted to this text box (no JS errors/warnings either)
Re: Javascript to check if anything is entered in editor
Updating in case anyone else finds this useful....
To work with the FCKEditor object you'll first need to put a handle on it:
Now you can do things like clear the data, or add data:
or change the background color when a key is pressed:
Issue the following after creating the textbox (like with window.onload) to attach an 'onkeyup' event to the fckeditorInstance. When a key is pressed it calls the resetEditorColor() function (above)
Now you can check to see if a FCKeditor object is blank (with FCKCopy). If blank, error/alert out, and change the background color to make it easier for users to spot on the screen. The AttachEvent will reset the background color to white (or whatever color) as soon as they enter anything.