title: checking the value of CKEditor and disabling the submit button if no content
body: <p>running a basic function that disables a form submit button depending on the input length.</p>
  
  <p>I am using this:</p>
  
  <pre><code>    // check if the newpost text area in empty on page load and also input change
  $(document).ready(function(){
      disableNewPost();
      $('#newpost').keyup(disableNewPost);
  });
  
  // disable new post submit button if the new post ckeditor is empty
  function disableNewPost() {
      if ($('#newpost').val().length &gt; 0) {
          $(".addnewpostbtn").prop("disabled", false);
      } else {
          $(".addnewpostbtn").prop("disabled", true);
      }
  }
  </code></pre>
  
  <p>This works with a normal text area see here:<a href="http://jsfiddle.net/QA22X/" rel="nofollow">http://jsfiddle.net/QA22X/</a></p>
  
  <p>But when working with CKEditor it doesn't work.</p>
  
  <p>I have done my research, but cant find anything that works.</p>
  
  <p>I saw this and tried it:</p>
  
  <pre><code>    // check if the newpost text area in empty on page load and also input change
  $(document).ready(function(){
      disableNewPost();
      var e = CKEditor.instances['#newpost']
      e.on( 'keyup', function( event ) {
      disableNewPost();
      });
  });
  
  // disable new post submit button if the new post ckeditor is empty
  function disableNewPost() {
      var value = CKEDITOR.instances['#newpost'].getData();
      if ($(value).length &gt; 0) {
          $(".addnewpostbtn").prop("disabled", false);
      } else {
          $(".addnewpostbtn").prop("disabled", true);
      }
  }
  </code></pre>
  
  <p>But that also doesn't work.</p>
  
  <p>Any help on this?</p>