Search code examples
jquerywysiwyg

Including an iframed WYSIWYG editor in a form submit


I am trying to include a WYSIWYG editor in a form that is ultimately sent via AJAX to the server. The problem is that serializing the form doesn't include the editor input because it's being rendered in an iframe on the page. This seems to be the way that "all" the editors do it (I've only tried 4).

My question is:

1.) How to include or retrieve the iFramed WYSIWYG edit field in a the serialized form for POSTing

or

2.) Is there a basic WYSIWYG HTML editor that doesn't use the iFrame approach, and would render an input field in the form that is being POSTed


Solution

  • If you use CKEditor (as you state that you have tested), you can call updateElement before serializing the form and the textarea will have the current data, or you can retrieve it by calling getData.

    For normal submits that operation is automatic, but as you're not using the form submit, then it won't work on its own.