automatically tab to next textbox

automatically tab to next textbox

  

Hi, 

I have 2 Text box in which the user can type a string for 1 character, 

I want the cursor move automatically to second text box  after user type a character 

How i can make this use javascript on mobile?

Hi,

Use the onChange Event of the first Textbox & Validate the input such that when one char entered than set the focus of desired textbox.

You can ref below to set the focus manually:

https://www.outsystems.com/forums/discussion/34872/set-focus-to-and-select-text-in-input-field/


Thanks



assif_tiger wrote:

Hi,

Use the onChange Event of the first Textbox & Validate the input such that when one char entered than set the focus of desired textbox.

You can ref below to set the focus manually:

https://www.outsystems.com/forums/discussion/34872/set-focus-to-and-select-text-in-input-field/


Thanks



Hi, Assif_tiger


Can you give me another solution? because we (Jonathan and me) use a mobile platform, for the example of the question we want to make a feature to input Personal Identification Number.


When we input 1 digit number in first box, it's automatically move to second box.


Solution

Hi Christopher & Jonathan,

Assif_tiger's suggestion of assigning a handler to On Change would be the way to go (or maybe to the onkeypress event instead, so as soon as one digit is pressed your handler gets triggered).

The link mentioned is to explain how you can dynamically set the focus on a specific element: you need to call the focus() method on the DOM element, using Javascript.

Hope this helps

Solution

Hi Jonathan,

Steps to Implement to get the cursor automatic switch from PIN input to next Text Input widget using JavaScript.

1) Form with inputs

2) Set the JavaScript action to onkeypress event.

3) Inside the action: Below Stated is the JavaScript Code to get focus on to the next input widget.

Hope that this explanation helped you to understand little bit more.

Note: If you found this explanation little bit helpful and contributing one, please mark the Jorge Martins reply as solution.


Kind Regards,

Benjith Sam


Thanks Guys