3 Replies Latest reply on Aug 3, 2011 1:12 PM by George_Johnson

    How to automatically select text when entering a form field?


      Hello everyone,


      So I have successfully taught myself enough javascript to create a really nice fillable form for my company, but there is one thing that I simply cannot figure out.


      How do you write a javascript for an On Focus action that will select all the text in the field, so the user can either copy/paste, delete it all, or just start typing?


      I researched this question but only found HTML javascript help, and neither this.select() or a SelectTheText function seem to work in my Adobe Acrobat form. The funny thing is, we are talking about a text field, but an adjacent number-formatted field (that is linked to a later calculation) automatically selects the number when you tab into the field, with no javascript written to do so. Yet this text field will simply not select all the text automatically, with or without a javascript action command.


      Let me know if you need to see the actual form, I'd have to delete some sensitive information from it and find a place to share it. But hopefully (?) someone else has encountered this problem and my explanation suffices...


      THANK YOU so much in advance!


      P.S. I use Adobe Acrobat, not LiveCycle. Tried to take it into LiveCycle and it just ruined the whole format. Thanks.