I want to send data to the database with Ckeditor, but I get the error “Cannot read properties of undefined (reading ‘p_Ack’)”. The editor I’m using is ckeditor’s document bundle editor where exactly am I going wrong?
<div class="card card-custom">
<div class="card-body">
<div id="kt-ckeditor-3-toolbar"></div>
<div id="p_Ack">
</div>
</div>
</div>
<script>
var KTCkeditorDocument = function () {
var demos = function () {
DecoupledEditor
.create(document.querySelector('#p_Ack'))
.then(editor => {
const toolbarContainer = document.querySelector('#kt-ckeditor-3-toolbar');
toolbarContainer.appendChild(editor.ui.view.toolbar.element);
})
}
return {
// public functions
init: function () {
demos();
}
};
}();
// Initialization
jQuery(document).ready(function () {
KTCkeditorDocument.init();
});
</script>
'Desc': KTCkeditorDocument.instances['p_Ack'].getData(),