1

I would like to get the value of FCKeditor in javascript for client side validation. The name of FCKedtor is 'article_des'.

I am trying to get value like below, but when i change the value of fckeditor then this code is not reflecting the new values entered in fckeditor.

alert(document.form_edit.article_des.value);

Its alerting old value.

My html code for FCKeditor:-

echo $this->formFckeditor('article_des',html_entity_decode($this->data['article_des']),array('size'=>'30','maxlength'=>'75'));

Actually i want to check that the value is not blank because its a required field.

How can i get the value in JS ?

Any help would be greatly apreciated.

Thanks a lot.

Bajrang
  • 8,361
  • 4
  • 27
  • 40
  • Which version of FCKEditor are you using? You may find this post helpful: http://stackoverflow.com/questions/3147670/ckeditor-update-textarea/7079054#7079054 – T. Junghans Feb 14 '12 at 11:59

1 Answers1

1

Try:


var oEditor = FCKeditorAPI.GetInstance('article_des');
alert(oEditor.GetXHTML(true));

//OR
var oEditor = FCKeditorAPI.GetInstance('article_des') ;
var pageValue = oEditor.GetHTML();

Hope it helps

Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162