I have a form called testform and a form field called testtextarea.
I use:
<script type="text/javascript">
CKEDITOR.replace( 'testtextarea',
{
height: 520,
width: 298
});
</script>
To produce the field but when I try to access it using
function GetContents() {
var html = CKEDITOR.testform.testtextarea;
alert( html.getData());
It doesn't produce any result.
Can someone please tell me what I am doing wrong?

for notification
for notification
Is this a difficult question?
Is this a difficult question?
Kinda, cause it's a bit
Kinda, cause it's a bit unclear. What do you mean by "doesn't produce any result"? What verison of CKEditor are you using? Do you have ACF setup to allow forms? Do you have the forms addon installed?
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Using version 4.2.1
Using version 4.2.1
The ckeditor is replacing a textarea field in an existing form, I'm not using it to build forms.
When I type text into the ckeditor field and click the form button that I think should pop up an alert box with the content, nothing happens.
You can see the form here: http://www.aquinasandmore.com/sku/16600/fuseaction/store.holycardform
bump
bump
Does anyone have an answer?
Does anyone have an answer?
Can't replace existing text
Having the same problem as the OP. I have the following code in 4.2.2.
CKEDITOR.replace( 'editor1x', {
width: divNotes.style.width,
height: divNotes.style.height,
toolbarCanCollapse : true,
toolbarStartupExpanded : false
});
...
<textarea id="editor1x" >this is a test</textarea>
Then if I add data to the editor and access the editor's content, all I get is the original text. Nothing that I added to the editor's text can be extracted. In Javascript, when I go to get the data with: var s = document.getElementById('editor1x').value, s is still equal to "this is a test" and none of the text I typed after "this is a test" is there.
Got it figured out
Ok, when you're not submitting a form, you can't get the data from the textarea without the following:
Which updates the field and then you can access the new data.