0

I'm trying to post CKEditor textarea value with AJAX.
I'm using this code founded in this community:

for (instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}

The value is posting not correctly. AJAX posts the old value.
Example:
If textarea1 value is 'hello', AJAX posts nothing. By clicking again the submit button, it sends 'hello'. Now if I update the value, with 'ciao', it sends 'hello' again, but if I resend the value, it posts 'ciao'.
I'm not sure if anyone has understood what I'm saying.
What's the problem?
Thanks.

tlenss
  • 2,609
  • 2
  • 22
  • 26
Francis
  • 77
  • 1
  • 5
  • 12

1 Answers1

0

Try this code

var value = CKEDITOR.instances['DOM-ID-HERE'].getData();

or

var value   = CKEDITOR.instances.'DOM-ID-HERE'.getData();
Kathiravan
  • 689
  • 1
  • 7
  • 22