please refer codepen
for this problem
/* Summernote Validation */
$(function () {
var summernoteForm = $('.form-validate-summernote');
var summernoteElement = $('.summernote');
var summernoteValidator = summernoteForm.validate({
errorElement: "div",
errorClass: 'is-invalid',
validClass: 'is-valid',
ignore: ':hidden:not(.summernote),.note-editable.card-block',
errorPlacement: function (error, element) {
// Add the `help-block` class to the error element
error.addClass("invalid-feedback");
console.log(element);
if (element.prop("type") === "checkbox") {
error.insertAfter(element.siblings("label"));
} else if (element.hasClass("summernote")) {
error.insertAfter(element.siblings(".note-editor"));
} else {
error.insertAfter(element);
}
}
});
summernoteElement.summernote({
height: 300,
callbacks: {
onChange: function (contents, $editable) {
// Note that at this point, the value of the `textarea` is not the same as the one
// you entered into the summernote editor, so you have to set it yourself to make
// the validation consistent and in sync with the value.
summernoteElement.val(summernoteElement.summernote('isEmpty') ? "" : contents);
// You should re-validate your element after change, because the plugin will have
// no way to know that the value of your `textarea` has been changed if the change
// was done programmatically.
summernoteValidator.element(summernoteElement);
}
}
});
});