Skip to main content

Posts

Showing posts with the label jquery ckeditor

Solution CKEDITOR Not updating textarea value on form submit

CKEditor Not updating Textarea value on form submit CKeditor is a very popular and free rich-text editor and it's easy to use, But sometimes we face an issue with it, like when we submit a form through ajax or PHP , it not submit the updated content and keep sending old content on form submit. So here is the solution to this issue Before submitting the form , add below code that will check all CKeditor instances and loop it and then will update its content, so after this code, if you have multiple textarea in your page, then still this code will work.  for ( instance in CKEDITOR.instances )         CKEDITOR.instances[instance].updateElement(); Example: In this example , I am submitting a form through ajax and I am adding code in it so textarea will have updated content. CODE:  $("#btnSaveDetails").on("click", function() {     var el = $(this);      for ( instance in CKEDITOR.instances ...