Hi there -
I have a simple form, containing a fckeditor field, with a JavaScript validation function attached to the form's onsubmit event. Among other things, this function makes sure the fckeditor contains text (i.e., was not left empty). It does this by checking document.getElementById("description").value (the hidden field that actually gets posted to the server when the form is submitted).
Here's the thing: if I bring up this form, enter text in the fckeditor, and click "Submit", it tells me that "description" contains an empty string. If I click "Submit" a second time, it works fine.
Apparently, the contents of fckeditor aren't copied into the hidden control immediately - something that happens between the first and second submissions forces the copy to happen. It's more of an annoyance than a critical issue, but I'd like to get it fixed.
Any suggestions? Does anyone know why this is happening? Is there a way to force fckeditor to perform this copy?
Thanks!
-Travis
I have a simple form, containing a fckeditor field, with a JavaScript validation function attached to the form's onsubmit event. Among other things, this function makes sure the fckeditor contains text (i.e., was not left empty). It does this by checking document.getElementById("description").value (the hidden field that actually gets posted to the server when the form is submitted).
Here's the thing: if I bring up this form, enter text in the fckeditor, and click "Submit", it tells me that "description" contains an empty string. If I click "Submit" a second time, it works fine.
Apparently, the contents of fckeditor aren't copied into the hidden control immediately - something that happens between the first and second submissions forces the copy to happen. It's more of an annoyance than a critical issue, but I'd like to get it fixed.
Any suggestions? Does anyone know why this is happening? Is there a way to force fckeditor to perform this copy?
Thanks!
-Travis
Re: Accessing fckeditor contents from JavaScript - weird behavio
With the API you can call the GetXHTML (now GetData) or UpdateLinkedField
Re: Accessing fckeditor contents from JavaScript - weird behavio
I tried UpdateLInkedField, but it returned 'undefined' - do you have to pass anything to it?
What about GetData? I don't see that in the API reference you linked to.