title: jQuery validation plugin + CKEditor - validate when typing
body: <p>I'm using CKEditor on a textarea and the jQuery validation plugin (<a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="nofollow noreferrer">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a>)</p>
  <p>With the jQuery plugin it's possible to mark a field as empty or required.
  When a field e.g. &quot;product name&quot; is empty the field will be marked as invalid when submitting the form.</p>
  <p>But, while typing in a &quot;product name&quot;, the field will be automatically marked as valid while typing. That's great, but I want to have the same with my CKEditor-enabled textarea. Everything works great with a plain textarea (when typing text, the field becomes valid), but this doesn't work anymore after adding CKEditor to the textarea.</p>
  <p>From then on, you have to click the submit button before the CKEditor textarea gets re-validated.</p>
  <p>Any  ideas on how I can make this work?</p>
  <p>UPDATE:</p>
  <p>I tried the solution from the thread you gave me but it doesn't work:
  <a href="https://stackoverflow.com/questions/924145/using-jquery-to-grab-the-content-from-ckeditors-iframe">Using jQuery to grab the content from CKEditor&#39;s iframe</a></p>
  <p>I have:</p>
  <pre><code>CKEDITOR.instances[&quot;page_content&quot;].document.on('keydown', function(event)
                  {
                      CKEDITOR.tools.setTimeout( function()
                      { 
                          $(&quot;#page_content&quot;).val(CKEDITOR.instances.page_content.getData()); 
                      }, 0);
          });
  </code></pre>
  <p>but that keeps giving me: &quot;CKEDITOR.instances.page_content.document is undefined&quot;</p>
  <p>The id of my textare is &quot;page_content&quot;</p>
  <p>This works fine after clicking on the button, but as you see I need to trigger the keydown event somehow</p>
  <pre><code>$(&quot;#btnOk&quot;).click(function(event) {
              CKEDITOR.instances.page_content.updateElement(); //works fine
  });
  </code></pre>
  <p>UPDATE 2:</p>
  <p>This code is correct and it gets the data from CKEDITOR into my textarea, but still, nothing is happening with my validation plugin, it's not &quot;responding as I type&quot; in the CKEDitor while it should react and say that the field is OK when I type in some text</p>
  <pre><code>CKEDITOR.instances[&quot;page_content&quot;].on(&quot;instanceReady&quot;, function()
          {
                  //set keyup event
                  this.document.on(&quot;keyup&quot;, updateTextArea);
                   //and paste event
                  this.document.on(&quot;paste&quot;, updateTextArea);
                  
          });
  
          function updateTextArea()
          {
              CKEDITOR.tools.setTimeout( function()
                      { 
                          $(&quot;#page_content&quot;).val(CKEDITOR.instances.page_content.getData());
                      }, 0);  
          }
  </code></pre>