Last Updated: February 25, 2016
·
15.38K
· tralamazza

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>

1 Response
Add your response

Greate advice, thanks ! I guess you also can use

<input type="hidden"/>

instead of textarea.

over 1 year ago ·