These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Autoselect text in field

DTjava
Registered: Jun 17 2011
Posts: 21

Seems like this would be pretty straightforward, but cruising through the API I can't seem to find a clear answer.
 
I want a user to be able to click on a text field, which then autoselects everything in the field. End result is when he starts typing, it automatically replaces the existing text.
 
I tried using "settextselection" with a mouseup action, but I'm pretty new at all this...no dice.
 
Any advice? Just trying to add a bit more user-friendly functionality.
  
Thanks as always!!

My Product Information:
Acrobat Pro 9.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
I don't think it can be done.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

DTjava
Registered: Jun 17 2011
Posts: 21
It wouldn't surprise me - I've ripped apart the internet looking for a scrap of code that might pull it off, and nothing seems to gel. I appreciate the insight! I can come up with a workaround from a layout standpoint if it can't be done.

Thanks!


D.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
I've done some experiments with the setFocus command, but it doesn't seem to select the contents of the field, I'm afraid. Maybe someone else knows of a trick to achieve this...

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com