Skip to main content
September 15, 2016
質問

text fields

  • September 15, 2016
  • 返信数 2.
  • 1304 ビュー

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();

このトピックへの返信は締め切られました。

返信数 2

JR Boulay
Community Expert
Community Expert
September 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
September 19, 2016

there is not way to unselect a field?

JR Boulay
Community Expert
Community Expert
September 19, 2016

I'm curious about the answer too.

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
September 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?

September 18, 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.

try67
Community Expert
Community Expert
September 18, 2016

Not possible in a PDF file.