Expand my Community achievements bar.

SOLVED

Set Focus

Avatar

Level 7

How I can set the focus with a button for a subform?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You could try an object like a button. Then sets its dimensions to be very small and have no caption, border or fill. The setFocus would work for that and then you could position this small object where you want the focus to be set.

Good luck,

Niall

PS You could also use xfa.host.currentPage to go to a particular page in the form. This will land the user at the top of that page.

View solution in original post

3 Replies

Avatar

Level 10

Hi,

A subform can't receive focus, so you can't set the focus to the subform (afaik).

You can set the focus to an object inside the subform:

xfa.host.setFocus("mySubform.TextField1"); 

Good luck,

Niall

Avatar

Level 7

Thanks Niall,

the all idea is to create something like a anchor.

Thanks again

Avatar

Correct answer by
Level 10

Hi,

You could try an object like a button. Then sets its dimensions to be very small and have no caption, border or fill. The setFocus would work for that and then you could position this small object where you want the focus to be set.

Good luck,

Niall

PS You could also use xfa.host.currentPage to go to a particular page in the form. This will land the user at the top of that page.