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

Editor - Remove HTML Tags for Reporting

1 Answer 459 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 20 Nov 2014, 01:50 PM
Hi there,

Having previously used the RadControls ASP.NET AJAX Editor, we had a requirement to store two copies of the entered information - one with HTML formatting and one without for reporting purposes.

I seem to recall this was quite trivial to implement at the time, as the Editor control provided a property which just had the plain text which we could store separately.

However, I can't seem to find an obvious way to achieve this with the Kendo Editor - unless I am missing something?

Thanks,

Paul

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 24 Nov 2014, 08:16 AM
Hello Paul,

While there is no built-in way for stripping html tags from the text you can do it using the JavaScrupt. replace() method. Here is an example:

var text = $('#editor').getKendoEditor().value()
var strippedText = text.replace(/(<([^>]+)>)/ig,"");

I hope this helps.

Regards,
Kiril Nikolov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Paul
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or