But you do script, and you're learning, which is what you need to do. As you learn the language more, you'll have fewer problems like this, or at least you'll be able to identify and fix them easier. A lot of people try to script without learning the language, which only makes things more difficult.

As a Mouse Script generic for a trigger button (next/previous page/ print form...):

checkFieldsOnPage(pageNum);

PD I am observing that some threads here are from designers who want to improve forms, but no so far as learning a lot of Java. The Indesign scripting forum is different as only very special situations are posted: the software is very strong and very well documented. In Acrobat all has to be scripted and a practical use of functions are a nightmare for designers. For example: validating fields is a must for today. But all the threads I read these days are unconcluded, not really clear. Validating field for something outside the Java circle is impossible. Perhaps something that alters the scenery is that scripted solutions are usually sold. It is a business behind it, something that does not happen frequently in Indesign.