Hi all,
I have two XML files - one is a list of categories, laid out like this:
<categories>
<category>
<categoryID>1</categoryID>
<categoryName>The Category</categoryName>
</category>
......
</categories>
And a subcategory XML file laid out like this:
<subcategories>
<subcategory>
<subcategoryID>1</subcategoryID>
<categoryID>1</categoryID>
<subcategoryName>The Subcategory</subcategoryName>
</subcategory>
......
</subcategories>
The category XML populates a select box. When that select box is
changed, a second select box for subcategory is populated using the
subcategory XML finding any records with the categoryID chosen in the
first box.
What I'm struggling with is how to filter the subcategory list according
to the value of the child categoryID tag BEFORE doing .each() on it. At
the moment I'm going through every subcategory and manually comparing
the categoryID child to the chosen categoryID - can I filter this using
jQuery so I don't have to do that?
This is my current code: http://pastebin.com/m236603b
All help appreciated. :)
Regards,
Michael Price