Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Cannot set focus when reset data using datasets

Avatar

Level 2

Hi All,

When I click reset form button. I would like to reset data then focus to the first field. I can clear information I provided but setFocus to the first name field is not working. Please help.

I use datasets to reset data. 

Here is my coding:
event: click

xfa.datasets.data.loadXML("<form1/>", true, true);

 

xfa.host.setFocus("xfa.form1.contactInformation.firstname")

Thanks,

Cindy

1 Accepted Solution

Avatar

Correct answer by
Level 8

Put the setfocus on the form:ready event of form1

View solution in original post

4 Replies

Avatar

Level 8

xfa.host.setFocus("form1.contactInformation.firstname")

Avatar

Level 2

I tested the clear button. But it is not set Focus to the first field. It is not successful.

Avatar

Correct answer by
Level 8

Put the setfocus on the form:ready event of form1