title: tinymce clear content on save/post
body: <p>I have written this to work as a basic placeholder for <code>textarea[placeholder]</code> and tinymce.</p>
  
  <pre><code>//set up a new editor functionality
  setup: function(ed) {
  
      // Set placeholder
      var $editorMce = $('#'+ed.id);
      var editorMce_placeholder = $editorMce.attr("placeholder");
      if(editorMce_placeholder.length){
          var is_placeholder = false;
  
          ed.onInit.add(function(ed) {                            
              // get the current content
              var cont = ed.getContent();
  
              // If its empty and we have a placeholder set the value
              if(cont.length == 0){
                  ed.setContent(editorMce_placeholder);
  
                  // Get updated content
                  cont = editorMce_placeholder;
              }
  
              // convert to plain text and compare strings
              is_placeholder = (cont == editorMce_placeholder);                   
  
              // nothing to do
              if (!is_placeholder){
                  return;
              }
          });
  
          ed.onMouseDown.add(function(ed,e) {
              // replace the default content on focus if the same as original placeholder
              if (is_placeholder){
                  ed.setContent('');
              }
          });
  
          ed.onSaveContent.add(function(ed, o) {
              // replace the content back to empty if the same as placeholder
              if(editorMce_placeholder == o.content){
                  ed.setContent('');
              }
         });
      }
  </code></pre>
  
  <p>This works up until the <code>// clear content</code>, </p>
  
  <p>I have tried <code>onSubmit</code>:</p>
  
  <pre><code>ed.onSubmit.add(function(ed, e) {
      // replace the content back to empty if the same as placeholder
      if(editorMce_placeholder == $(ed.getContent()).text()){
          ed.setContent("");
          // just to be sure:
          $editorMce.val("");
      }
  });
  </code></pre>
  
  <p>And also <code>onPostProcess</code>:</p>
  
  <pre><code>ed.onPostProcess.add(function(ed, e) {
      // replace the content back to empty if the same as placeholder
      if(editorMce_placeholder == $(ed.getContent()).text()){
          o.content = '';
      }
  });
  </code></pre>
  
  <p>All without effect of clearing the textarea value/iframe content on submit it you dont change the value it gets saved with the placeholder value. </p>