title: enable Submit button on ckeditor validation
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
          &lt;head&gt;
                &lt;meta charset="utf-8"&gt;
                  &lt;title&gt;CKEditor&lt;/title&gt;
                  &lt;script src="https://cdn.ckeditor.com/4.19.0/standard/ckeditor.js"&gt;&lt;/script&gt;
          &lt;/head&gt;
          &lt;body&gt;
  &lt;textarea cols="10" id="editor1" name="editor1" rows="10" onkeyup="val()"&gt;&lt;/textarea&gt;
  
  &lt;input type="button" name="next" value="Submit" id="nxtbtnwht1" disabled/&gt;
  
          &lt;script&gt;
                   CKEDITOR.replace( 'editor1' );
                     function val()
                      {
          
                      var a = CKEDITOR.instances['editor1'].getData();
  
          
                          if(a!==null || a!==""){
            
                          document.getElementById("nxtbtnwht1").disabled = false;
                         }
                        else
                       {
                         document.getElementById("nxtbtnwht1").disabled = true;
                        }    
                  }  
              &lt;/script&gt;
          &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I have ckeditor 4 in one page. On page, submit button is by default disabled I want to put validation on ckeditor4 textarea on check whether it is empty or not if it is empty put button as disabled and if some text is in ckeditor textarea then button should be visible. So How can I Do it with Javascript?</p>
  <p>Ckeditor Textarea code:</p>
  <pre><code>&lt;textarea cols=&quot;10&quot; id=&quot;editor1&quot; name=&quot;editor1&quot; rows=&quot;10&quot; onchange=&quot;val()&quot;&gt;&lt;/textarea&gt;
  </code></pre>
  <p>Submit Button Code:</p>
  <pre><code>&lt;input type=&quot;button&quot; name=&quot;next&quot; value=&quot;Submit&quot;  id=&quot;nxtbtnwht1&quot;  disabled/&gt;
  </code></pre>
  <p>Javascript code:</p>
  <pre><code>function val()
    {
      
      var a = CKEDITOR.instances['editor1'].getData();
      
      
      if(a!==null || a!==&quot;&quot;){
       
      document.getElementById(&quot;nxtbtnwht1&quot;).disabled = false;
      }
      else{
        document.getElementById(&quot;nxtbtnwht1&quot;).disabled = true;
      }
    }
  </code></pre>