Query re setting focus

Explorer ,
Mar 14, 2019

Copy link to clipboard

Copied

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, Macintosh

Views

79

Likes

Translate

Translate

Report

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

Query re setting focus

Explorer ,
Mar 14, 2019

Copy link to clipboard

Copied

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, Macintosh

Views

80

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 14, 2019 0

Have something to add?

Join the conversation