I have a list and using caml query I pass the criteria to select an item for which there are mutiple lookupfields and I need to bind them to a dropdown list. This is my code so far where it just returns the first value and not all the values.
var x = "<Query><Where><Eq><FieldRef Name=\'Make\'/><Value Type=\'Text\'>" + make + "</Value></Eq>" +
"<Eq><FieldRef Name=\'Model\'/><Value Type=\'Text\'>" + model + "</Value></Eq>" +
"<Eq><FieldRef Name=\'Category\'/><Value Type=\'Text\'>" + classification + "</Value></Eq>" +
"</Where></Query>";
var retval = "";
$().SPServices({
operation: "GetListItems",
listName: "Stations",
async: false,
CAMLQuery: x,
completefunc: function(xData, ID) {
$(xData.responseXML).find("[nodeName=z:row]").each(function() {
retval = $(this).attr("ows_IssueIDMenu");
});
}
});
alert(retval);
}
Can someone please help me with the code to iterate through the values and load them into an array and bind it to the dropdown list as this is the first time that I am using JQuery and going nowhere.
retval should be an array instead of a string