Skip to main content
deckarduk
Inspiring
March 14, 2019
Question

Query re setting focus

  • March 14, 2019
  • 0 replies
  • 330 views

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.

This topic has been closed for replies.