-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
Is there a way to be able to get the value without html tags in CKEditor?
Thank you!
Hi there,
That's not the default use case of CKEditor, since CKEditor is meant to returned formatted text. By retrieving the plain text value, you may not get "all of the data" from the editor widget.
This said, according to the CKEditor forums, the solution for this is to do editorInstance.document.getBody().getText() on the JS editor object.
In a ZK context, you'll have to add a few extra things around it: https://zkfiddle.org/sample/1bi71ub/1-ckeditor-retrieve-text
In this case I used the w:onChange client-side listener to retrieve and send the text value everytime "onChange" happens, but you could have any other wiring on this front. I also used a custom event listener onCustomRetrieveText to retrieve the text value in composer.
Asked: 2022-11-28 17:47:40 +0800
Seen: 6 times
Last updated: Nov 29 '22