Ok, I am doing my nut trying to figure this out...
I have a page that pulls up a bunch of XML data and it is working fine.
I then decided to add a search box on this and other pages that will make this page only show the results of my search.
I know that the page is receiving the form data and that it is being correctly stored in variables.
I want to use those variables to then filter the results of my xml file.
What I have currently is;
var x=xmlDoc.getElementsByTagName("ResidentialProperty");
mySearch = location.search.substr(1).split("&")
function getFromSearch() {
var x = 0
mySearch = location.search.substr(1).split("&")
for (x=0;x<=mySearch.length;x++) {
eval("document.forms.myNewForm."+mySearch[x])
}
}
document.write(mySearch);
for (i=0;i<x.length;i++) {
var item = x[i];
document.write("<div class='property'><div class='list_name'>");
if(item !== undefined) {
var itemElements = item.getElementsByTagName("StreetNumber");
if(itemElements.length > 0) {
if(itemElements[0].childNodes.length > 0) {
document.write(x[i].getElementsByTagName("StreetNumber")[0].childNodes[0].nodeValue+' ');
}
}
}
if(item !== undefined) {
var itemElements = item.getElementsByTagName("StreetDirPrefix");
if(itemElements.length > 0) {
if(itemElements[0].childNodes.length > 0) {
document.write(x[i].getElementsByTagName("StreetDirPrefix")[0].childNodes[0].nodeValue+' ');
}
}
}
etc.
This is all working but every time I try to filter it just stops all results returning.
Please help.