I have a section in my form where you can add multiple subforms by clicking a button. i also have a field within the subform that only appears when one of 4 radio buttons is checked. if the radio button is checked then the user adds multiple subforms by clicking the button, the hidden fields appear as they are suppose to. If the user then changes their selection and chooses another radio button, it should remove the fields on each instance. the problem is that if it is only removing fields from the first and last instance, but nothing in between.
Under the change event of the radio buttons I have used the following (for radio buttons 1, 3 and 4)
when these buttons are clicked i want Text1 & Text2 to hide on all instances.
var intNewIndex = form1.subfrm1.instanceManager.count-1;
and for radio button 2 i have the following under the change event:
for Radio button 2 i want Text1 and Text2 to appear on all instances.
var intNewIndex = form1.subfrm1.instanceManager.count-1;
form1.resolveNode("subfrm1[" + intNewIndex + "]").Text1.presence = "visible";
form1.resolveNode("subfrm1[" + intNewIndex + "]").Text2.presence = "visible";
Thanks in advance for your help,
Nik
Views
Replies
Total Likes
Hi Nik,
If using JavaScript you will need a loop to go through all of the instances, changing the presence of the objects in each instance in turn. There is an example of looping though repeating objects using both xfa.resolveNode() and xfa.resolveNodes(). http://assure.ly/kUP02y.
If using FormCalc, then you could use the wildcard to access all instances:
subfrm1[*].Text1.presence = "hidden"
subfrm1[*].Text2.presence = "hidden"
The wildcard doesn't work in JavaScript, because the compiler interprets [] as an array.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi Niall, thank you for your help. I have looked at the link you provided however I am not a programmer by trade, therfore some of this is confusing to me. Are you able to show me an example of how it should be written if its not too much trouble?
Thanks again,
Nik
Views
Replies
Total Likes
Hi Nik,
Can you share your form? If so, then upload it to a file sharing site (like Acrobat.com); publish it and then post the published link here.
Niall
Views
Replies
Total Likes
i dont mind sending it to you, but it cant be posted for the public to see. is this still possible?
Views
Replies
Total Likes
Could I send it to you through email?
Views
Replies
Total Likes
Contact me via http://www.assuredynamics.com and I will have a look when I can.
Niall
Views
Replies
Total Likes