PDA

View Full Version : get attribute from xml after form submitting



stefano
24 Nov 2010, 1:27 PM
Hi
I submit a form having an XML as response as the following:


<message success="true" id="10">
Saved!
</message>


action.response.responseText
In the onSuccess event called when the form is submitted successfully I would like to retrieve from the xml the "id" attribute (10 in my example);
How can I do this?
I can retrieve the text using action.response.responseText but I don't know how get an attribute of the XML. Is it possible?

Thank you
bye
stefano

Condor
25 Nov 2010, 7:36 AM
Use response.responseXML instead of responseText and use DomQuery to locate the id attribute value.