I'm trying to use a radio button to control a repeating subform and the subform containing it. When the value for the radio button is "no", the containing subform is hidden, but the repeating subform contained within it isn't altered (so in case someone makes a mistake they don't lose all of their data). When the radio button value is "yes", the containing subform is rendered visible, and I'd like to have it add an instance of the repeating subform only if there are no instances of it currently. Unfortunately, I can't get the second part to work, and for various reasons I can't use the Initial Count or Minimum Count properties in the Bindings tab. Here's the code I'm using (in the "change" event of the radio button group):
if (this.rawValue=='1'){
Container_Subform.presence="visible";
if (Container_Subform.Repeating_Subform.instanceManager.count=='0')
Container_Subform._Repeating_Subform.addInstance(1);
xfa.form.recalculate(1);
}
I'm thinking it must be something simple, but I can't think of it. Thanks in advance for your help.
if (degCent < 100)
{
If(degCent >0)
{
document.write("degCent is between 0 and 100");
}}
So I think it would either be this:
if (this.rawValue=='1'){
Container_Subform.presence="visible";
if (Container_Subform.Repeating_Subform.instanceManager.count=='0'){
Container_Subform._Repeating_Subform.addInstance(1);
xfa.form.recalculate(1);
}
}
or this:
if (this.rawValue=='1'){
Container_Subform.presence="visible";}
if (Container_Subform.Repeating_Subform.instanceManager.count=='0'){
Container_Subform._Repeating_Subform.addInstance(1);
xfa.form.recalculate(1);}