These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How do you select an item in a List Box

ShellBell
Registered: Jul 26 2007
Posts: 7
Answered

The first page of my document contains a list box. The user will select an item from the list box. This will then take them to the destination selected. I have a button on each destination that says "Return to Main Menu". When they click on this button I want it to go to the list box on page 1 and select the first item in the list box. How do I do that?

So far I have this written on the Return to Main Menu button.

{
gotoNamedDest("SelectBranch")
var f = this.getField("lstBranchOffice")
var v = f.getItemAt(0)
app.alert (v)
}

but I don't know how to set the focus to the first item in the list.

Thanks for any help you can give me - I'm pretty new at this javascript and don't use it often.

ShellBell
Registered: Jul 26 2007
Posts: 7
I finally figured it out.

gotoNamedDest("SelectBranch")
var f = this.getField("lstBranchOffice")
f.currentValueIndices = [0] // Select the first Item [0] in the List Box