Expand my Community achievements bar.

SOLVED

select the text in a text field when it is clicked on?

Avatar

Former Community Member

I would like to change my form so that when a text field is clicked (by a user in adobe reader) all of the text in the field is selected.  This is the default behaviour when you are tabbing through the form but I would like to do this even if the text field is just clicked.

As part of the same question I would also like to know if there is a script that can be used to create keyboard input?  If there is another way to do it it would be preferable but it might be handy if I could program the form so that when a text field is clicked the keys "Ctrl" and "A" are pressed to highlight it and "Ctrl" and "c" to copy the text, since that would be the main objective of the form is copying and pasting to a clients website.

1 Accepted Solution

Avatar

Correct answer by
Level 2

The first part of your question can be done by putting the following code in the click event (JavaScript) of the text field:

xfa.host.setFocus(null);

xfa.host.setFocus(this);

View solution in original post

2 Replies

Avatar

Correct answer by
Level 2

The first part of your question can be done by putting the following code in the click event (JavaScript) of the text field:

xfa.host.setFocus(null);

xfa.host.setFocus(this);

Avatar

Former Community Member

This works for single line fields. How can I select all the text in a multiline field?