Re: Style tag in Head tag problem (removed by editor)

  •  07-25-2008, 5:28 AM

    Re: Style tag in Head tag problem (removed by editor)

     
    Ok, probably the final word on this, unless CuteSoft support can solve my final issue below.  
     
    As Andy pointed out, the STYLE in the HEAD tag is not stripped out if you set the following property on the editor...

         Editor1.EnableStripStyleTagsCodeInjection = false;

    This is great and appears to work well, however, if you try to "save" the HTML by using the built-in Save button then the Editor1.Text that you get the other end still strips the STYLE tag from the HEAD tag and sticks the contents in the BODY tag.  So, I fixed this by...
     
    1) Removing the standard Save button
    2) Adding my own custom Save button that calls a SaveHtml() javascript function, which works a bit like this...
     

    function SaveHtml() {
      // Get live HTML from editor
      var html = document.getElementById('CE_Editor1_ID').getHTML();
      // Push into hidden form-post field
      document.getElementById('htmldata').value = html;
      // Post form
      document.form1.submit();
    }

View Complete Thread