ACE editor form submit
Add an invisible Textarea and update it either before submit, or on every change:
js
var editor = ace.edit('editor');
var textarea = $('textarea[name="editor"]');
editor.getSession().on("change", function () {
textarea.val(editor.getSession().getValue());
});
html
<form>
<label for="editor">Editor</label>
<div id="editor"></div>
<textarea name="editor" style="display: none;" />
</form>
Written by Daniel Tralamazza
Related protips
1 Response
Greate advice, thanks ! I guess you also can use
<input type="hidden"/>
instead of textarea.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Html
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#