Avatar

Correct answer by
Level 10

Hi,

Yes you can, you just need to count the current number of instances of the subform (data) and then set the focus to a field in that instance:

_data.addInstance();

var i = _data.count - 1;


xfa.host.setFocus(xfa.resolveNode("data[" + i + "].firstName"));

The underscore before the name of the subform is shorthand for "instanceManager".

Sample here: https://acrobat.com/#d=2pAry7PSy7HdLPidEU2XHQ

Hope that helps,

Niall

View solution in original post