Curser stay in a first and default field

I setup a form in a popup windows .

I want to set the mouse curser stay at the first field in the input form when I open the windows and the form.

How about this method ?

Here it is: … irstactive

For your example link,

myform.setFocusOnFirstActive (“user_name”)

“user_name” is a field name in a form

The usage is correct ?

Yes, “user_name” is the name of the form’s item, which you need to set focus when the pop-up window is opened.