Hello!
Inside a subform I have a "Copy" button that copy the entire subfom.
What I want: when user press "Copy", except for coping the subform, I want to set focus on a object (any object) inside newly copied subform.
Is it possible?
Solved! Go to Solution.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Thank you.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies