I am trying to use a combo box to control the layers (OCG's) in my acrobat form. Using the mouse it works perfectly fine. However, I want my users to be able to use only the keyboard if they desire. That is, use their up/down arrows to select the combo box value and then tab off and continue. For some reason when I change the layers visibility property it messes with my combo box and I can't use my keyboard to make the selection (again it works fine when using the mouse). Is there something going on behind the scenes that I don't know about - some reset command or something?. Or is my changeEx and incorrect method for this approach? Any insight would be appreciated.
Here is my code:
if (event.changeEx == "A")
{
ocgs[2].state = false
ocgs[3].state = false
ocgs[4].state = true
ocgs[5].state = false
}
else if (event.changeEx == "B")
{
ocgs[2].state = true
ocgs[3].state = false
ocgs[4].state = false
ocgs[5].state = false
}
else if (event.changeEx == "C")
{
ocgs[2].state = true
ocgs[3].state = true
ocgs[4].state = false
ocgs[5].state = false
}
else if (event.changeEx == "D")
{
ocgs[2].state = false
ocgs[3].state = false
ocgs[4].state = false
ocgs[5].state = true
};
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script