If I change any text or give backspace checkbox will unchecked and value will 0 in Ckeditor. I tried but I can't do it. How can I solve this problem?
CKEDITOR.replace( 'editor1' );
<script src="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.js"></script>
<input type="checkbox" id="description" value="1" checked>
<textarea name="editor1">Lorem ipsum dolor amet</textarea>
You can listen event change of CKEDITOR.instances
const checkbox = document.getElementById('description');
CKEDITOR.replace('editor1');
for (const i in CKEDITOR.instances) {
CKEDITOR.instances[i].on('change', function () {
checkbox.checked = false;
checkbox.value = 0;
});
}
or instance that you need
const checkbox = document.getElementById('description');
CKEDITOR.replace('editor1');
CKEDITOR.instances.editor1.on('change', function () {
checkbox.checked = false;
checkbox.value = 0;
});