How to Add CKEditor Required Field Validation in JQuery?

By Hardik Savani June 2, 2023 Category : jQuery

Hey Friends,

In this quick guide, we will teach you ckeditor required field validation. you will learn ckeditor validation not working. I’m going to show you about jquery validation engine ckeditor. I would like to show you ckeditor required field validation javascript. Here, Create a basic example of javascript validation for ckeditor textarea.

we can add required field validation easily using jquery if we have textbox, textarea, select box etc, but if we used ckeditor then it's not simple. In this example i give you how to add Ckeditor required field validation in javascript. we can do it using CKEDITOR.instances, so if you also require then you can use it.


<html lang="en">


<title>Jquery - ckeditor required field validation</title>

<script type="text/javascript" src="//"></script>

<script src="//"></script>



<div class="container text-center">


<textarea name="editor"></textarea>




CKEDITOR.replace( 'editor' );

$("form").submit( function(e) {

var messageLength = CKEDITOR.instances['editor'].getData().replace(/<[^>]*>/gi, '').length;

if( !messageLength ) {

alert( 'Please enter a message' );








I hope it can help you...

Tags :