javascript - CKEditor - Using GetData() -
i struggling implementing following:
i have button creates cke instance (outside form):
<button type="submit" class="btn btn-default btn-sm" onclick="javascript: var editor81 = ckeditor.replace('divtext81')" value="edit">edit</button>
i have save button (outside form):
<button type="submit" class="btn btn-default btn-sm" id="save81" value="save">save</button>
i use following javascript post mysql database:
$(document).ready(function (argument) { $('.btn').click(function () { id = $(this).attr('id').replace('save',''); $edit = ckeditor.instances.editor81.getdata(); $cid = $('#cid' + id).val(); $action = $('#action' + id).val(); $eid = $('#eid' + id).val(); $.ajax({ url: 'include/editupdate.php', type: 'post', data: { data: $edit, cid: $cid, eid: $eid, action: $action }, datatype: 'html', success: function (rsp) { alert(rsp); } }); }); });
the information posts fine database except not pick data editor instance, field blank. of other fields ok. suffix 81 record id.
i know how close editor instance after posting database.
many thanks