We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Remove all default HTNL tags except content of <body>

Hi,

Is there a way with RTE to remove all the HTML tags of the document except the content of <body>, ie when I see the HTML content of the text it gives me <html>, <head> etc. with a lot of stuff inside, I only want to pass the content of body to the controller.

Also it is possible to have the character count include the HTML parts instead of just the "View" part, as I have limitation on the size of the field ?

Thank you,

3 Replies

KR Keerthana Rajendran Syncfusion Team September 26, 2017 01:06 PM UTC

Hi JP Gutton, 
 
Thank you for using contacting Syncfusion support. 
 
Query 1: Is there a way with RTE to remove all the HTML tags of the document except the content of <body>, ie when I see the HTML content of the text it gives me <html>, <head> etc. with a lot of stuff inside, I only want to pass the content of body to the controller. 
 
To pass the content of RTE we suggest you to use getText() method which will return the content of RTE. Please refer to the below given code 
 
function gettext() 
    { 
        var obj = $("#RteSample").data("ejRTE"); 
        alert(obj.getText()); 
 
    } 
 
We have attached a sample for reference. Please download the sample from 
 
 
Query 2: Also it is possible to have the character count include the HTML parts instead of just the "View" part, as I have limitation on the size of the field ? 
 
Characters count will be based on the number of characters present inside editor and HTML parts cannot be included in this count. 
 
Regards, 
Keerthana 



JG JP Gutton September 27, 2017 02:33 PM UTC

Thank you for your answer !



KR Keerthana Rajendran Syncfusion Team September 28, 2017 04:06 AM UTC

Hi JP Gutton, 
 
Thanks for your update. Please get back to us if you require further assistance on this. We will be happy to assist you 
 
Regards, 
Keerthana. 


Loader.
Up arrow icon