Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

text fields

Guest
Sep 15, 2016 Sep 15, 2016

hi,

i have a form with 3 text fields.

i want to go to the next field if the current field if empty.

i used the following code and it works but, when the focus is set to the next field and the field is not empty the text in the next field is marked.

if the text is marked and the user type a letter the text in the field gets deleted.

how can i prevent that?

if ( event.fieldFull || event.willCommit ) this.getField("NextTabField").setFocus();

TOPICS
Acrobat SDK and JavaScript , Windows
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 15, 2016 Sep 15, 2016

You need to better explain what you want to achieve.

What event should trigger this action? When the user exits the field? Enters it? Something else?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 17, 2016 Sep 17, 2016

hi,

because i have 3 fields for the user to enter free text, i want it to be comfortable for input.

i need to code 2 things:

1, when the user is typing in the first field and the space ends, i want the cursor move to the next field.

2. when the user deletes the text in the second field, i want the cursor move to the first field and i don't want the text in the first field to be highlighted.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2016 Sep 18, 2016

Not possible in a PDF file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 18, 2016 Sep 18, 2016

setting the cursor to the next field is possible.

setting the cursor the the previous field is possible.

my only problem is making the text not highlighted.

whats not possible?

i'm sure there is something that i can do.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 19, 2016 Sep 19, 2016

Hi.

if the text is marked and the user type a letter the text in the field gets deleted.

how can i prevent that?

The text is not highlighted, it's selected.

So, typing over a selected text remove it, as usual in any software.

Nothing can prevent that since it's by design.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 19, 2016 Sep 19, 2016

there is not way to unselect a field?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 19, 2016 Sep 19, 2016

I'm curious about the answer too.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 24, 2016 Sep 24, 2016

anyone?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 25, 2016 Sep 25, 2016

I don't know of a way.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2016 Sep 25, 2016

You can't do it directly. You can unselect a field by selecting another one using a script, though.

So just create a dummy field (it can even be hidden) and then set the focus to it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 25, 2016 Sep 25, 2016

I believe he wants the text field to have the focus, but without all of the text selected, so your initial answer was correct.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 25, 2016 Sep 25, 2016

thanks for all the answers.

its really weird that there is no way to do that.

i guess my customers will have to live without this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2016 Sep 25, 2016
LATEST

It's literally a single key-press. Surely it's not that big a deal...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines