I've just recently started using LiveCycle Designer (7.0) and learning JavaScript. I am learning a lot perusing this forum but picking things up piecemeal. I can't figure this out.
I have multiple subform instances with the same objects. One of those objects is a drop-down list. When the form is loaded, I want to assign the same list items to each drop-down on each subform using a function. For instance, this function is the script object Enrollment.SelectedPayers.#variables[0].#script[0]:
function fillList(myList)
{ myList.clearItems()
myList.addItems("Name1","ID1")
myList.addItems("Name2","ID2")
myList.addItems("Name3","ID3")
}
I want to fill Enrollment.SelectedPayers.Payer[*].PayName by calling this function.
Questions:
Where should I call the function so the lists will be filled when the document loads?
How do I call the function so it updates the drop-down? Using direct reference or variable?
This, of course, is a very simplified version of what I'm actually doing. I would appreciate any examples you can provide. I do know how to iterate through the Payer subforms.