Search code examples
asp.netfckeditor

Using <b> in fckeditor


i want to print some default string value in bold but i am using tag but it is not rendered as bold rather it is showing it is printing the same etc

var defaultFCKValue = '----Original Message---- \n';
            defaultFCKValue += '<b>From:</b> ' + from + '\n';
            defaultFCKValue += '<b>Sent:</b> ' + date + '\n';
            defaultFCKValue += $('div.popupContent div div.message').html();
            var oEditor = FCKeditorAPI.GetInstance("<%=FCKeditorSelfDocument.ClientID %>");
            var oDOM = oEditor.EditorDocument;
            oDOM.body.innerText = defaultFCKValue;

Solution

  • The problem is that the <b> tags are being escaped/encoded and are being rendered as &lt;b&gt;

    You might want to try using

    oEditor.setHtml(defaultFCKValue)
    

    See the js docmentation for fckeditor.