This is a migrated thread and some comments may be shown as answers.

Editor Value

1 Answer 66 Views
Editor
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 05 Jun 2013, 10:02 PM
Is there a way to get editor value without the html tags, such as a kendoEditor.text() field?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 06 Jun 2013, 01:26 PM
Hello John,

This is not supported out of the box. At present the editor API gives opportunity to get the HTML string value or to get the HTML encoded string value.

In order to string the HTML tags I suggest you to use a regex (or other custom logic). For example:
function stripHTML(html) {
    return html.replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi, '');
}
 
var editor = $("#editor").data("kendoEditor");
 
var value = stripHTML(editor.value());
console.log(value);

I hope this information will help.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
John
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or