Skip to main content
Inspiring
May 19, 2026
Answered

Multi page PDF jumps to specific page unexpectedly can't find setFocus() command causing page change

  • May 19, 2026
  • 1 reply
  • 27 views

I have a multi page PDF filled with lots of JavaScript actions and calculations for various fields.  Somewhere in my code I must have a setFocus() to a field that is getting executed unexpectedly.  My PDF document will jump to a single page unexpectedly after several different Button Fields run their code.

I have used advanced search to try to find instances of setFocus() in my JavaScript but it shows 0 instances.  Any suggestions???   WES

 

    Correct answer wes@ESA

    Got it worked out.  Thanks.  WES

    1 reply

    wes@ESAAuthor
    Inspiring
    May 19, 2026

    Found the place where the setFocus() was being executed.  It was in validation script of a dropdown field.  I was trying to make the dropdown selection populate other text fields without having to click outside the dropdown field after the selection had been made by the user.

    Any suggestions to make the javascript code in the dropdown populate the other text fields immediately on selection of the dropdown item?   I have checked the “commit selected value immediately” already.  WES

    wes@ESAAuthorCorrect answer
    Inspiring
    May 19, 2026

    Got it worked out.  Thanks.  WES