Validate CKEditor Fields Using JQuery validation

Today, We want to share with you Validate CKEditor Fields Using JQuery validation.In this post we will show you Validate CKEditor Using jQuery Validate, hear for bootstrap validation ckeditor textarea we will give you demo and example for implement.In this post, we will learn about Validate ckeditor using Jquery form validation with an example.

List of all Google Adsense, VueJS, AngularJS, PHP, Laravel Examples.

Snippet Contents

Validate CKEditor Fields Using JQuery validation

There are the Following The simple About Validate CKEditor Fields Using JQuery validation Full Information With Example and source code.

As I will cover this Post with live Working example to develop Validate CKEditor Fields Using JQuery, so the ckeditor html5 required,ckeditor jquery for this example is following below.

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

HTML Part

index.html



<title>Validate ckeditor using Jquery form validation</title>



<h3>Validate CKEditor Fields Using JQuery - Example</h3>
<form class="form-horizontal" role="form" name="productDescfrm" id="productDescfrm">
    <div class="col-xs-8 ck_edior_error">
        <textarea class="ckeditor" name="content" id="content"></textarea>
        
    </div>
</form>


Script JS Files

$("#productDescfrm").validate({
    rules: {
        content: {
            required: true,
            minlength: 10
        }
    },
    messages: {
        content: "Enter Describe your issue here in details"
    },
    errorPlacement: function(error, element) {
        if (element.attr("id") == "content") {
            //element.parent('div').prev().append(error[0]);
            $(".ck_edior_error").append(error[0]);
        } else {
            error.insertAfter(element);
        }
    },
    submitHandler: function () {
        alert('successful Form submit');
    }
});

CKEDITOR.on('instanceReady', function () {
    $.each(CKEDITOR.instances, function (instance) {
        CKEDITOR.instances[instance].document.on("keyup", CK_jQ);
        CKEDITOR.instances[instance].document.on("paste", CK_jQ);
        CKEDITOR.instances[instance].document.on("keypress", CK_jQ);
        CKEDITOR.instances[instance].document.on("blur", CK_jQ);
        CKEDITOR.instances[instance].document.on("change", CK_jQ);
    });
});

function CK_jQ() {
    for (instance in CKEDITOR.instances) {
        CKEDITOR.instances[instance].updateElement();
    }
}

Validate ckeditor using Jquery form validation
Angular 6 CRUD Operations Application Tutorials

Read :

Summary

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

I hope you get an idea about Validate CKEditor Fields Using JQuery 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.


Related FAQ

Here are some more FAQ related to this Article:

  1.   Laravel 6 select distinct and order by Example
  2.   Merger of vodafone and Idea News
  3.   PHP Create ZIP File In Laravel Using Zipper package
  4.   jQuery Validate CKEditor value is blank or not
  5.   jquery validate CKEditor example with rules and messages
  6.   PHP upload custom file in ckeditor Example
  7.   Create dynamic calendar using jQuery, Ajax and PHP
  8.   AngularJS Login Script using PHP MySQL
  9.   Pure JavaScript Star Rating Example
  10.   Bootstrap 4 Carousel Text Slider Example

Leave a Reply

Your email address will not be published. Required fields are marked *