Subform1.presence =”invisible”;
case ‘Hidden (Exclude from Layout)’:
Subform1.presence =”hidden”;
Subform1.presence =”visible”;
var nSubLength = Subform1.nodes.length;
var sSelectField = fieldList.rawValue;
The following script uses the replace method to remove all of the spaces from the name of the field stored in the
sSelectField variable, which allows the value of the drop-down list to match the name of the object in the Hierarchy palette:
sSelectField = sSelectField.replace(‘ ‘, ”);
for (var nCount = 0; nCount < nSubLength; nCount++) {
switch(xfa.event.newText) {
Subform1.nodes.item(nCount).presence = “invisible”;
case ‘Hidden (Exclude from Layout)’:
Subform1.nodes.item(nCount).presence = “hidden”;
Subform1.nodes.item(nCount).presence = “visible”;
var nSubLength = Subform1.nodes.length;
var sSelectButton = buttonList.rawValue;
The following script uses the replace method to remove all of the spaces from the name of the button stored in the
sSelectField variable, which allows the value of the drop-down list to match the name of the object in the Hierarchy palette:
sSelectButton = sSelecButton.replace(/\s/g, ”);
for (var nCount = 0; nCount < nSubLength; nCount++) {
if ((Subform1.nodes.item(nCount).className == “field”) &
Subform1.nodes.item(nCount).name == sSelectButton)) {
This script uses a switch statement to handle the five presence values that a form filler can apply to button objects.
switch(xfa.event.newText) {
Subform1.nodes.item(nCount).presence = “invisible”;
case ‘Hidden (Exclude from Layout)’:
Subform1.nodes.item(nCount).presence = “hidden”;
case ‘Visible (but Don\’t Print)’:
Subform1.nodes.item(nCount).presence = “visible”;
Subform1.nodes.item(nCount).relevant = “-print”;
case ‘Invisible (but Print Anyway)’:
Subform1.nodes.item(nCount).presence = “invisible”;
Subform1.nodes.item(nCount).relevant = “+print”;
Subform1.nodes.item(nCount).presence = “visible”;
Use the resetData method to reset all of the drop-down lists to their default values:
Use the remerge method to remerge the form design and form data. In this case, the method effectively returns the objects in the Form Objects area to their original states: