Ive attached a version the populates the city combo "by hand". I think the codes a little easier to read, plus I cant remember off-hand how to pass params to XSL using javascript
(youll need a param to filter the cities per state).
Sorry about the reformatting of the HTML file. I prefer the script at the top and I dont like using SCRIPT FOR... - just my preference and it was easier for me as I was debugging: your City XML was invalid, no closing tags on the <City> nodes.
When filling the State combo, its interesting to note that you can create your own attributes and pull out values as if they were part of the DOM.
For example, change:
<xsl:attribute name="value"><xsl:value-of select="StateID"/></xsl:attribute>
to
<xsl:attribute name="StateID"><xsl:value-of select="StateID"/></xsl:attribute>
Youll create an option tag that looks like:
<option StateID="1">Nevada</option>
Now you can reference the StateID with code like:
var stateID = States.options[States.selectedIndex].StateID;
Notice that the last piece of this line, StateID, is an attribute of the option element. Pretty cool, as you arent limited to storing one value per option tag. Only works in IE of course, but then again so do the XML islands
If you decide to go with using a transform to fill the City list, youll have to define a param in the XSL and fill it from the javascript. Or, you can cheat - which is how Ive done it in the past - and use the XSL island as XML (which it is) and perform a selectSingleNode to find your template match and change it dynamically based on the current stateID.
Have fun!
-Nerseus