tags:

views:

165

answers:

2

Hai

I want to validate (empty check) a tiny mce text editor using JavaScript. Does any one know this? I have used the normal empty check function. But it's not working. Does any one help me? also I want to know how validate empty check in FCk editor.

A: 

Try Following in your javascript

if(tinyMCE.get("chatContent_field").getContent()==''){
   alert("Please enter the text.");
   return false;
}

wheer "chatContent_field" is id of your text area

Salil
many tks. i am very curious to know this in the case of FCK editor. can you please tell me? once again very thanks
Testadmin
ya it's in the case for tinyMCE WYSWYG Editor. is it working for u?
Salil
ya, it's working for me. Thanks. Also i need to validate a FCk editor. Is there is any other method to validate(empty) Fckeditor? Please Reply for this..
Testadmin
A: 

The editor should put its content in the textarea it's installed upon, but it might do it after You check. Try using firebug to see what Your editor does to the textarea it covers.

If You want to check directly You have to find the iframe within the editor and access its content.

naugtur