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.

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




Validate ckeditor using Jquery form validation



Validate CKEditor Fields Using JQuery - Example

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.

Leave a Comment