Set focus to next text input field

Hello

I need some help. I have various text input fields in my project. I would like the focus to switch to the next text input field after correctly sending the answer.

So what I mean is: I have field “X” and after typing the answer and sending it with “Enter” I want the field “Y” to be automatically focused so I can directly start typing the next answer.

Is there a way to do that with js?

I already enter the following js to the “On correct” of the first text input field but it’s not working:

prez.object(“Y_Punkt1”).node.focus()

Hi,

You can do that by adding the following JavaScript action to On Text Enter event of each text box:

 // replace next_textbox_name by the name of the next text box
prez.object('next_textbox_name').textNode.focus();

Regards,
Hoa

2 Likes

This worked for me. Thank you very much.