<!-- Load the editor sdk from the local folder or https://cloud.squidex.io/scripts/editor-sdk.js -->
<script src="editor-sdk.js"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/10.0.0/classic/ckeditor.js"></script>
<textarea name="content" id="editor"></textarea>
var element = document.getElementById('editor');
// When the field is instantiated it notified the UI that it has been loaded.
var field = new SquidexFormField();
// Handle the value change event and set the text to the editor.
field.onValueChanged(function (value) {
// Disable the editor when it should be disabled.
field.onDisabled(function (disabled) {
editor.set('isReadOnly', disabled);
editor.model.document.on('change', function () {
var data = editor.getData();
// Notify the UI that the value has been changed. Will be used to trigger validation.
field.valueChanged(data);
editor.ui.focusTracker.on('change:isFocused', function (event, name, isFocused) {
// Notify the UI that the value has been touched.