Hi all.
I'm using your wonderful tools. Really good.
My only problem for the moment is I can't check the FCKeditor value with JavaScript.
I have to check if the user let empty the text of the editor but, cause the input is 'hidden', I can't use the JS check
if obj.FCKeditor.value.lenght==0
How can I check if nothing is written in the editor?
Thank you a lot.
Wed, 06/21/2006 - 06:40
#1
RE: Cannot chek if there is no text with JS
function getfck(ed_name){
if (document.all) return (document.all[ed_name].contentWindow.document.all['eEditorArea']).contentWindow.document.body.innerHTML;
else if (document.getElementById) return (document.getElementById(ed_name).contentWindow.document.getElementById('eEditorArea')).contentWindow.document.body.innerHTML;
}
Then I test the returned value to see if it's empty or not. But since version 2.3, I've been getting JS error messages saying 'contentWindow' is null or not an object.
Does anyone know why? Thanks!
RE: Cannot chek if there is no text with JS
Yes it would really appreciated some help.

I need absolutely to check the value via JS.
Or at least I need a function that can retrieve the value and pass it to a JS check function.
I'll try this code, but as you said I fear it won't work on my version
Please developers!! Help Us!! :>
Thank you!
RE: Cannot chek if there is no text with JS
function fck_filled(ed_name){
if (FCKeditorAPI.GetInstance(ed_name).GetXHTML() == "") return false;
else return true;
}
if (!fck_filled('description')) alert('The editor is empty');
else alert('The editor has something in it');