You probably have the same button on multiple pages. When you request the page information for a field, and it's only on one page, then you will get the page number directly. If the field is on more than one field, you will get an array of page numbers. You will have to check if event.target.page is a number or an array, and then handle the array accordingly.
Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com