I have a replicant drop-down (events) with mulitple options and I want to check each drop-down to see if a value exists. If it does exist then I want to pass the id of the replicant to an array. However when I run the following function, it breaks on the last line when I try to set the value. The error message that I get is:
TypeError: xpath.indexOf is not a function
| | var index = xpath.indexOf(".."); |
| | |
function checkCollectOptions () {
var myRootNodes = IWDatacapture.getItem("/events").getChildren();
var featured_event = IWDatacapture.getItem("/featuredEvent");
var strResults1 = new Array();
for (var i=0; i<myRootNodes.length; i++) {
var id_val = myRootNodes[i].getChildByName("id").getValue();
var collect_val = myRootNodes[i].getChildByName("collections").getValue();
if (collect_val.indexOf(0) != -1) {
strResults1.push(id_val);
}
}
IWDatacapture.getItem(featured_event).setValue(strResults1);
}