XML DOM and Javascript
Hi everyone,
I've been struggling enough with this thing, so I decided to finally ask for help.
My web application consists of a series of htm pages that need be accessed as "steps" in a process.
I am using mainly XML DOM and java script in order to get the information typed by the users in the forms.
After filling the form in the first step, I need to "save" that information somehow and send it to the next page.
I am simulating serialization of an object, collecting all the input from the form and holding it as a string using a java script function:
function GetXML(fm)
{
var strXML = new String();
strXML = "<?xml version='1.0'?>\n";
strXML = strXML + "<root>\n";
strXML = strXML + "<name>\n";
strXML = strXML + "\t<first>" + fm.First.value + "</first>\n";
strXML = strXML + "\t<last>" + fm.Last.value + "</last>\n";
strXML = strXML + "</name>\n";
strXML = strXML + "<phones>\n";
strXML = strXML + "\t<phoneno typeID='" + fm.PhoneType.value + "' type='" + fm.PhoneType.options[fm.PhoneType.selectedIndex].text + "'>" + fm.PhoneNo.value + "</phoneno>\n";
strXML = strXML + "</phones>\n";
strXML = strXML + "<email>" + fm.Email.value + "</email>\n";
strXML = strXML + "<address street='" + fm.Street.value + "' city='" + fm.City.value + "' state='" + fm.State.value + "' zip='" + fm.Zip.value + "'></address>\n";
strXML = strXML + "</root>";
return (strXML); //this value will be returned and sent to the "next step"
}
My problem:
How do I access this xml document (returned by the function) in the next "step" of my application? Can I save it at the client, adding nodes to it, until I am ready to submit it to an .asp page for further processing???
I would appreciate any help I could get. This thing is pulling my brains out... :) Thanks...
lilu
|