Adobe acrobat forms javascript object specification User Manual

Page of 64
Acrobat Forms - JavaScript Object Specification
49
Returns: nothing
This method sets the list of items for a combo box or a list box. The single parameter necessary
to call this method must be an array. Each element in the array must either be an object
convertible to a string or another array. If the element can be converted to a string, the user and
export values for the list item are equal to the string. If the element is an array it must consist
of two sub-elements. The first sub-element should be convertible to a string which will be used
as the user value, the second element will be used as the export value.
var l = this.getField("ListBox");
l.setItems(["One", "Two", "Three"]);
var c = this.getField("StateBox");
c.setItems([["California", "CA"],["Massachusetts", "MA"],["Arizona", "AZ"]]);
var c = this.getField("NumberBox");
c.setItems(["1", 2, 3, ["PI", Math.PI]]);
See also the
,
and
field methods.