Skip to main content
Inspiring
January 30, 2018
Question

How to programmatically focus a field in a dialog?

  • January 30, 2018
  • 2 replies
  • 1344 views

I don't see a focus() method documented under the dialog documentation but when I inspect the dialog keys I see that one of them is ​focus​. Is there a way to accomplish this?

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
January 31, 2018

Is there any documentation on undocumented functions?

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
January 31, 2018

Sure. It's available in a book written in Ancient Sanskrit, sold only by Blockbuster.

try67
Community Expert
Community Expert
January 30, 2018

Where did you see that?

Thom Parker
Community Expert
Community Expert
January 30, 2018

Yes, there is an undocumented Focus function in the runtime dialog object.  Its input is the item_id of target field.

There are many undocumented functions, properties, and options for the dialog object.  Some are undocumented because they are incomplete, or never worked out. But for some it's just like Adobe just decided scripting wasn't important and stopped development/support. Documenting something means you have to support it.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
January 30, 2018

Yeah, I'm aware of many of these functions (like the image loading one), but wasn't aware of the focus option, except for the first_tab parameter. Neat.