jQuery CKEditor Validation Example with demo

Today, We want to share with you jQuery CKEditor Validation.In this post we will show you Ckeditor required field validation example in Jquery, hear for Validate CKEditor Fields Using JQuery we will give you demo and example for implement.In this post, we will learn about ckeditor required field validation with an example.

jQuery CKEditor Validation

There are the Following The simple About jQuery CKEditor Validation Full Information With Example and source code.

As I will cover this Post with live Working example to develop Validate CKEditor Using jQuery Validate, so the some major files and Directory structures for this example is following below.

Required field validation ckedito

ckeditor cdn

First if all You include jQuery as well as ckeditor CDN in Your Project.

  • JQuery-2.2.4.js
  • JQuery.Validate.js
  • CKEditor.js

We have HTML Source code like –

<form id="product_img">   
		<label>Image<span class='required'>*</span></label> 
		<span class="field"> 
		<textarea  name="ckproduct_img" id="ckproduct_img"></textarea> 
	<input type="submit" value="submit">  

I applied CKEditor on above textarea name as ckproduct_img –


var obj  = { 
	stylesSet : [ 
	{name: 'Align Left', element: ['p','h1','h2','h3','h4','h5','h6','td','th','div','ul','ol','li','table','img'], attributes: {'class': 'text-left'}}, 
	contentsCss  : ['/assets/admin/css/custom.css'], 
	removeButtons :  JustifyLeft
CKEDITOR.replace('ckproduct_img', obj); 


jQuery.validator.addMethod('ckrequired', function (value, element, params) { 
	var idname = jQuery(element).attr('id'); 
	var messageLength =  jQuery.trim ( CKEDITOR.instances[idname].getData() ); 
	return messageLength.length !== 0; 
}, "Image field is required"); 

Then write the validation rule for the text area as –

ignore: [], 
rules: { 
	ckproduct_img: { 
	ckrequired: true 
messages: {         
	ckproduct_img: { 
	ckrequired : "Please select an Any image required" 

Including a default text in CKEditor

<!DOCTYPE html>
        <meta charset="utf-8">
        <title>Ckeditor required field validation example in Jquery</title>
        <script src="ckeditor/ckeditor.js"></script>
	<h1>ckeditor 4 Examples</h1>
        <textarea id="liveEditor" name="liveEditor" id="liveEditor"> 
			<p> pakainfo is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development. We deliver the useful and best tutorials for web professionals β€” developers, programmers, freelancers and site owners. Any visitors of this site are free to browse our tutorials, live demos and download scripts.
			<br />
			<b> Conclusion </b>
			<script type="text/javascript">

how to use ckeditor in php

simple add or embed CKEditor in php page

Also Read This πŸ‘‰   PHP artisan dump-autoload Fix "class not found"

    $CKeditor = new CKeditor();
    $CKeditor->BasePath = 'ckeditor/';

Angular 6 CRUD Operations Application Tutorials

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jQuery CKEditor Validation.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.