Hello,
I’m trying to embed a editor to a HTML form and submit, but the edit content doesn’t get posted.
So here is my page structure
....
....
....
....
....
....
So basically I don’t know how to assign a name to the attached editor and I dont know how can I post the editor content along with other input elements when click
In a simplified version, here is the code:
<link rel="stylesheet" type="text/css" href="./codebase/dhtmlx.css">
<script src="./codebase/dhtmlx.js" type="text/javascript"></script>
<form action="" method="post">
<div id="editorObj" style="width: 100%; height: 300px; border: #a4bed4 1px solid;"></div>
<button type="submit">OK</button>
</form>
<script>
var editor;
dhtmlx.image_path = "./codebase/imgs/";
editor = new dhtmlXEditor("editorObj");
</script>
editor data can be got by getContent() method:
var data = editor.getContent();
You may add hidden field into the form and put the editor content in it on form submit:
...