Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ckeditor Example
HTML
----------------------
<script src="https://cdn.ckeditor.com/4.15.0/standard/ckeditor.js"></script>
<div>
<textarea style="display:none;" id='terms_of_conditions' name='terms_of_conditions' > {{$content}} </textarea>
<button type="button" id="submit" class="btn btn-info">Save<div class="ripple-container"></div></button>
</div>
JQUERY
--------------------
$(document).ready(function () {
CKEDITOR.replace( 'terms_of_conditions' );
CKEDITOR.config.allowedContent = true;
CKEDITOR.config.contentsCss = _base_url + '/css/terms-style.css';
document.querySelector( '#submit' ).addEventListener( 'click', () => {
const editorData = CKEDITOR.instances['terms_of_conditions'].getData();
$.ajax({
type: 'POST',
url: _base_url + "/terms-of-service",
dataType: 'json',
data: {_token:_token,content:editorData},
success: function (response) {
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.