Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
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