Forum Discussion
cbruck_1
15 years agoOccasional Contributor
I had to use TC 6 at my previous employer after TC 7 was released. Here's a snippet from our framework that I think might accomplish what you're looking for. Basically, you have to search through the children of the object and check their value (apparently for some it was contained in .text, hence the multiple conditions on the if statement). When you find it, you set the .value property for the object and fire the "onchange" event. I think this effecticely does a ClickItem (after finding the right item in the list).
case "SELECT" : {
for (var i = 0; i < fieldObject.children.length; i++) {
if ((uppercase(value) == uppercase(fieldObject.children.value)) ||
(uppercase(value) == uppercase(fieldObject.children.text))) {
returnText = stripJunk(fieldObject.children.value); //return the text of the selected entry.
fieldObject.value = fieldObject.children.value;
fieldObject.FireEvent("onchange");
server.Page.Wait();
}
}
return returnText;
break;
}
case "SELECT" : {
for (var i = 0; i < fieldObject.children.length; i++) {
if ((uppercase(value) == uppercase(fieldObject.children.value)) ||
(uppercase(value) == uppercase(fieldObject.children.text))) {
returnText = stripJunk(fieldObject.children.value); //return the text of the selected entry.
fieldObject.value = fieldObject.children.value;
fieldObject.FireEvent("onchange");
server.Page.Wait();
}
}
return returnText;
break;
}