Javascript and XML

M

MasterChief

I have an XML file that stores the addresses of all of our locations.
Then next I have a XSL file that displays the name of each of the
locations in a drop-down box. What is the easiest way to make it so
when the user choses Admin from the name list it goes back, gets the
rest of the information and displays it into textboxes. So when a user
clicks on Admin the text box for city is populated by the information
in the xml file for the Admin City. Some of what I started with is
below.

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="locations.xsl"?>

<Locations>

<store>
<name>Admin</name>
<address>Test</address>
<city>Test</city>
<state>Test</state>
<zip>Test</zip>
<country>United States</country>
</store>

</Locations>

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Locations</h2>
Store Name:
<select name="Locations">
<xsl:for-each select="Locations/store">
<option><xsl:value-of select="name"/></option>
</xsl:for-each>
</select>
<input type="text" name="address" /><br>
..
..
..
</body>
</html>
</xsl:template>
</xsl:stylesheet>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top