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

Query re setting focus

Contributor ,
Mar 14, 2019 Mar 14, 2019

Hi there,

Having read Thom Parker's nice article on formatting text fields Im using the code below to check for user input.

If the input is not a number then reject it.

if(!event.willCommit)    

    event.rc = !isNaN(event.change);

What I've been trying to do is take this one step further. If a number has been set on a particular field then set the focus to the next field in the sequence.

I've been using the code below to set the focus:

getField("theNextField").setFocus();

What I haven't been able to do yet is combine the 2. So, check if the user input is a number. If it is, move to the next field.

Please can someone point me in the right direction.

Thank you in advance.

TOPICS
Acrobat SDK and JavaScript
310
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
no replies

Have something to add?

Join the conversation