We can use javascript or jquery to apply ckeditor configuration
HTML
<textarea id=”textarea” cols=”15″ name=”txtdesc” rows=”5″></textarea>
Javascript
Must be included ckeditor.js
Take the instance of ckeditor and replace with new configuration
<script type=”text/javascript”>
var editor = CKEDITOR.instances[‘txtdesc‘];
if (editor) { editor.destroy(true);
}
var editorContent =CKEDITOR.replace(‘txtdesc‘, {
toolbar: [
{ name: ‘document’, items: [ ‘Source’, ‘-‘, ‘NewPage’, ‘Preview’, ‘-‘, ‘Templates’ ] }, // Defines toolbar group with name (used to create voice label) and items in 3 subgroups.
[ ‘Cut’, ‘Copy’, ‘Paste’, ‘PasteText’, ‘PasteFromWord’, ‘-‘, ‘Undo’, ‘Redo’,’SelectAll’, ‘RemoveFormat’ ], // Defines toolbar group without name.
‘/’, // Line break – next group will be placed in new line.
{ name: ‘basicstyles’, items: [ ‘Replace’,’Bold’,’TextColor’, ‘Italic’,’JustifyLeft’,’JustifyCenter’,’JustifyRight’,’JustifyBlock’,’Font’,’-‘,’Form’,’Checkbox’,’Radio’,’TextField’,’Textarea’,’Select’, ‘NumberedList’, ‘BulletedList’, ‘-‘, ‘Link’, ‘Unlink’,’SpecialChar’ ] }
]
});
</script>