1.6

Table Of Contents
In a Control Script, an entire section could be enabled or disabled based on the same
condition:
if (record.fields["Country"] == "CANADA") {
merge.template.contexts.PRINT.sections["Section 1"].enabled =
true;
} else {
merge.template.contexts.PRINT.sections["Section 1"].enabled =
false;
}
(For more information about Control Scripts, see "Control Scripts" on page545.)
The next script looks up a value in the first record of a detail table and shows or hides the
results depending on that value:
if (record.tables["detail"][0].fields["prod_id"] == "10") {
results.show;
} else {
results.hide;
}
remove()
Removes each element in a set from the DOM.
This function returns a new result set containing each removed element. These can be
changed and inserted in the document. This could be beneficial in terms of performance, as
manipulating elements inside the DOM is relatively time consuming.
Examples
This script removes all Span elements found in the template.
results.remove();
Selector Paragraph
before script
execution
Paragraph after
script execution
span <p>Lorem ipsum <p>Lorem ipsum
Page 789