Hi karenriviam.
I am not sure what language you use, but this is a generic function in Jscript/Java that will walk the wItems of a list, looking for a match, then it should set the index. It assumes the object supports the properties wItemCount, wItem, wSelectedItem, so it doesn't do any error trapping.
Also, it could be expanded for other types of lists/objects that have different properties. A simple validation of which properties it supports is needed. (i.e., aqObject.IsSupported(object, property/method))
Additionally, I am not sure setting the index using wSelectedItem will work so you might need to find a Method that sets/selects the item, look in the list of Methods.
The three additional functions are the calling functions for your specific controls.
I hope this helps.
function selectListItem(objElement, strValue)
{
// walk all of the items and compare to the passed value
for (var i = 0; i < objElement.wItemCount; i++)
{
if (aqString.Compare(objElement.wItem(i).wText, stringValue, false) == 0)
{
// use the found index to select the item from the list
objElement.wSelectedItem = i; // if this doesn't work then look for a Method that might select or set the item
break;
}
}
}
function setDOBDay(strValue)
{
var dobDayElement = //your Code for selecting the DOB Element or the mapped object;
selectListItem (dobDayElement, strValue);
}
function setDOBMonth(strValue)
{
var dobMonthElement = //your Code for selecting the DOB Element or the mapped object;
selectListItem (dobMonthElement, strValue);
}
function setDOBYear(strValue)
{
var dobYearElement = //your Code for selecting the DOB Element or the mapped object;
selectListItem (dobYearElement, strValue);
}