![MACROMEDIA COLDFUSION STUDIO 4.5-USING COLDFUSION... Use Manual Download Page 75](http://html1.mh-extra.com/html/macromedia/coldfusion-studio-4-5-using-coldfusion/coldfusion-studio-4-5-using-coldfusion_use-manual_3288175075.webp)
Exchanging Data via XML
75
Transferring Data from Browser to Server
This example serializes form field data, posts it to the server, deserializes it, and
outputs the data. For simplicity, only a small amount of data is collected. In
applications where complex JavaScript data collections are generated, this basic
approach can be extended very effectively.
<!--- Get WDDX JS utility objects --->
<script language="JavaScript"
src="/CFIDE/scripts/wddx.js"></script>
<!--- Add data binding code --->
<script>
// Generic serialization to a form field
function serializeData(data, formField)
{
wddxSerializer = new WddxSerializer();
wddxPacket = wddxSerializer.serialize(data);
if (wddxPacket != null)
{
formField.value = wddxPacket;
}
else
{
alert("Couldn't serialize data");
}
}
// Person info recordset
var personInfo = new WddxRecordset(new Array("firstName",
"lastName"));
// Add next record
function doNext()
{
nRows = personInfo.getRowCount();
personInfo.firstName[nRows] =
document.personForm.firstName.value;
personInfo.lastName[nRows] =
document.personForm.lastName.value;
document.personForm.firstName.value = "";
document.personForm.lastName.value = "";
}
</script>
<!--- Data collection form --->
<form action="wddx_browser_2_server.cfm" method="post"
name="personForm">
<!--- Input fields --->
Personal information<p>
First name: <input type=text name=firstName><br>
Summary of Contents for COLDFUSION STUDIO 4.5-USING COLDFUSION...
Page 1: ...Allaire Corporation Using ColdFusion Studio ColdFusion Studio 4 5 for Windows 95 98 NT4 2000...
Page 16: ...xvi Contacting Allaire...
Page 90: ...82...
Page 130: ...122...
Page 133: ...141 Two VTML tags CAT and E let you customize the content of these dialog boxes...
Page 182: ...190...