I would like to know if it is possible to disable all fields in a subform when a new instance is added?
Views
Replies
Total Likes
Are you referring to the old subform?
e.g., I'm filling out a job application and adding my previous experience. I enter the information for job 1, then click a button "add another." The Job1 information becomes read-only.
Adding this to the click event for your button that creates a new instance (or whatever applicable event) will do that.
var q = sfRepeat.instanceManager.count - 1;
sfRepeat.instanceManager.addInstance();
xfa.resolveNode("sfRepeat["+q+"].tfTest").access = "readOnly";
Views
Replies
Total Likes
Yes that is exactly what I would like to do. Am I able to appy that code directly to my form? The subform I would like to repeat has several fields, primarily text.
Views
Replies
Total Likes
Yes, just delete the .tfTest in the last line.
var q = sfRepeat.instanceManager.count - 1;
sfRepeat.instanceManager.addInstance();
xfa.resolveNode("sfRepeat["+q+"]").access = "readOnly";
Views
Replies
Total Likes
That worked perfectly! Thank you so much for your help!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies