Step 2 - Getting Data From XStandard
Unlike form elements, plug-in controls don't send data back to the server. To get around this, Web developers use a common technique that is reliable and easy to implement. Before the page is submitted, copy the data from the editor into a hidden field using JavaScript. When the form is submitted, the server-side script (ASP, PHP, ColdFusion, etc.) will read the data from the hidden field.
This is an example of JavaScript copying data from XStandard into a hidden field:
<html>
<head>
<script type="text/javascript">
function myOnSubmitEventHandler() {
document.getElementById('editor1').EscapeUnicode = true;
document.getElementById('xhtml1').value = document.getElementById('editor1').value;
}
</script>
</head>
<body>
<form method="post" onsubmit="myOnSubmitEventHandler()" action="mypage.htm">
<p>
<object type="application/x-xstandard" id="editor1" width="100%" height="400">
<param name="Value" value="Hello World!" />
</object>
</p>
<p>
<input type="hidden" name="xhtml1" id="xhtml1" value="" />
<input type="submit" name="btnAction" value="Submit" />
</p>
</form>
</body>
</html>
This is an example of a server-side script (in this case an ASP example) reading data from the hidden field:
<%
strXHTML = Request.Form("xhtml1").Item
%>