Simple HTTP POST Sample
This edit-on Pro sample demonstrates how to POST content to the server.
Pressing the "Submit" button retrieves content from the editor using the Javascript API method "getHTMLData". This content is then stored in a form field. Finally, the form is submitted to the "view.php" script, which displays the editor's content.
This is the source code of the function that is called when pressing the "submit" button:
function scriptForm_onsubmit() {
	// retrieve the document in the editor and store it in the form field "HTMLText"
	document.SubmitContent.HTMLText.value = eop.getHTMLData();
	// retrieve the style sheet used by the editor and store it in the form field "CSSText"
	document.SubmitContent.CSSText.value = eop.getStyleSheet();
	// Submit the form with the fields "HTMLText" and "CSSText"
	document.SubmitContent.submit();
}
Back to Samples Index