Skip to main content
Participating Frequently
Feb 3, 2016 8:13 PM UTC
Answered

Cursor focus in first form field

I have Adobe Acrobat Pro XI.  How do I make the cursor appear in the first form field when the document is opened?

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Feb 3, 2016 8:20 PM UTC

Let's say the field is called "Text1". Go to Tools - JavaScript - Document JavaScripts and add a new script (let's call it "load") with this code:

this.getField("Text1").setFocus();

Click OK, save the file and you're done.

6 replies

Participating Frequently
Feb 25, 2020 8:39 PM UTC

I know this is an old thread but for reasons, hopefully I can still get help, I don't understand I cannot get the script to correctly work. I created a form in MS Word, saved it as a PDF, Opened it in Acrobat XI Pro, created a form, added the load script. When I open the document in Acrobat the cursor is at the top of the page just before the text.

 

I'll admit I'm a real dummy and attempted to just follow the instructions. I noticed that Acrobat added more stuff to the Javascript and I assumed that it was needed. For me Javascript is like talking to a fish. 

 

Translate
Participating Frequently
Feb 25, 2020 9:37 PM UTC

OK reread the entire post and saw "And don't put it inside a function. Delete any code that is automatically generated when you create the script."

 

Now it works! Thanks

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Feb 3, 2016 8:20 PM UTC

Let's say the field is called "Text1". Go to Tools - JavaScript - Document JavaScripts and add a new script (let's call it "load") with this code:

this.getField("Text1").setFocus();

Click OK, save the file and you're done.

Translate
SammisueAuthor
Participating Frequently
Feb 3, 2016 8:35 PM UTC

You.Are.Awesome

I have been trying to figure this out for two days!

I did what you said and it worked immediately!

Muah!  Thanks!

Translate
Participant
Nov 10, 2016 7:57 PM UTC

Hi!  I did that and it does not focus on my PDF... Do I have to call the function somewhere? If so, where do I have to call it?

Thanks so much for the help!

Translate