Search code examples
jqueryckeditor

How to add an input type text to CKEditor


I am trying to make simple web editor using CKEditor but i cant find out how to make it work with input type text, It working well in textarea.

First i checked their samples site. Only thing they do to make CKEditor work is include .js file and add ckeditor class to form input type text element.

<script src="../ckeditor.js"></script>
.
.
.
<input type="text" class="ckeditor" name="editor1" >

How I add ckeditor in input type = text ?


Solution

  • Using

    CKEDITOR.replace( 'editor1' );
    

    with HTML like

    <input type="text" class="ckeditor" name="editor1">
    

    should just work, check this codepen. Maybe check for errors in the browser console or if the ckeditor.js file is loaded properly?