Page 1 of 1

function to set focus on object after event

Posted: Tue Jul 11, 2023 10:10 am
by capstefano
Hi there
in there an inbuilt nu-function to set the focus on an object on an edit form after another's object (input) is filled with a value?
(the event is intended to be a barcode scanning action that fills a first object, after that I'd like to have the focus on the second object, ready to be filled by the user)

Re: function to set focus on object after event

Posted: Tue Jul 11, 2023 11:06 am
by kev1n
Hi,

Add a keypress event handler to the object or use addEventListener.

Then set the focus on the other input with

Code: Select all

$('#id_of_your_other_input').focus();