Skip to main content
Participating Frequently
February 3, 2016
Answered

Cursor focus in first form field

  • February 3, 2016
  • 2 replies
  • 4487 views

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 has been closed for replies.
Correct answer try67

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.

2 replies

Participating Frequently
February 25, 2020

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. 

 

Participating Frequently
February 25, 2020

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

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 3, 2016

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.

SammisueAuthor
Participating Frequently
February 3, 2016

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!

Participant
November 10, 2016

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!