For anyone interested, the solution is as follows:
dojo.require("dojo.io.*");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.xml.* ");
dojo.require("dojo.html");
dojo.require("dojo.hostenv");
function init()
{
var x = new dojo.io.FormBind({
formNode: "Form1",
load: function(load, data, e) {
var xml, divList;
xml = dojo.xml.domUtil.createDocumentFromText(data);
divList = xml.getElementsByTagName("your-xml-tag-name");
dojo.byId('your-div-container').innerHTML = dojo.dom.innerXML(divList.item(x)); //x being the numerical position of the element you are after..0,1,2 etc etc etc
},
error: function(type, error) {
alert("Error: " + type + "n" + error);
}
});
}
dojo.addOnLoad(init);
So what happens with the above is as follows:
1. I wrapped my form section, <ft:form/>, inside a div tag with an id ref. When the form is submitted dojo submits the whole page, but the above takes out only,in my case form, section from the return.
regards
Andrew
On 13/07/06, Andrew Madu <[EMAIL PROTECTED]> wrote:
Hi,
I am trying to get my head round dojo.xml.Parse, but with little joy! I get a returned document from a form submit as follows:
formNode: "Form1",
load: function(load, data, e) {
//Parse data and extract form element
//Return form element to document
dojo.byId('output').innerHTML = data;
}
What I want to do is extract from the <form> node from the returned html. In java I would extract the element as follows:
DomParser parser = new DOMParser();
parser.parse(data);
Document document = parser.getDocument();
NodeList nodes = document.getElemenByTagName("form");
How would I acheive the same using dojo?
regards
Andrew
