Editor - Remove HTML Tags for Reporting

2 posts, 0 answers
  1. Paul
    Paul avatar
    28 posts
    Member since:
    Mar 2013

    Posted 20 Nov 2014 Link to this post

    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?


  2. Kiril Nikolov
    Kiril Nikolov avatar
    2543 posts

    Posted 24 Nov 2014 Link to this post

    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.

    Kiril Nikolov

    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.

  3. UI for ASP.NET AJAX banner
Back to Top