Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Remove a subform permanently using javascript

$
0
0

I have a travel approval form that has two sections -- Domestic and Foreign.  Both sections have many required fields.  I set up a radio button at the top to select one of those options, so if the user selects Domestic, I want the Foreign section to disappear completely.  The problem I'm having is that it doesn't disappear -- it's no longer visible but it seems to reside somewhere in memory.  Then, when I use a Submit button to send the completed form, I get an error message saying there are required fields somewhere that are incomplete.  I have checked this scenario thoroughly, and the Domestic section is completely filled out.  I have made all fields visible to make sure I'm not missing anything.  When I remove the Foreign section within LiveCycle, the problem goes away, so I'm pretty sure that it's giving me the error because it detects the required fields in the Foreign section as incomplete.

 

In the radio button at the beginning of the form, I have:

 

// Show "DOMESTIC" section
if (this.rawValue == "1") {  form1.Domestic.presence = "visible";  form1.Foreign.presence = "inactive";
}

// Show "FOREIGN" section
if (this.rawValue == "2") {
  form1.Foreign.presence = "visible";  form1.Domestic.presence = "inactive";
}

 

For lines 4 and 10 I have also tried using:

 

_Foreign.setInstances(0);

 

In the Submit button of the Domestic section I have this code:

 

if (_Foreign.count > "0") {  _Foreign.occur.min = "0";  Foreign.presence = "inactive";
}

Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>