Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

function to set focus on object after event

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
capstefano
Posts: 21
Joined: Sat Jan 21, 2023 12:17 am
Has thanked: 19 times
Been thanked: 4 times

function to set focus on object after event

Unread post 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)
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: function to set focus on object after event

Unread post 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();
Post Reply