Please like, comment, and subscribe before downloading the code.
1. Displaying & Hiding Fields Based on Value
var C = xfa.resolveNode("$record.NAME").value;
if (C == 'TEST')
{ this.presence = "hidden"; }
else
{ this.presence = "visible"; }
2. Setting Background Color Based on Value
var C = xfa.resolveNode("$record.NAME").value;
if (C == 'TEST')
{ this.fillColor = "255,0,0"; }
3. Setting Font Color Based on Value
var C = xfa.resolveNode("$record.NAME").value;
if (C == 'TEST')
{ this.font.fill.color.value = "255,0,0"; }
4. Changing Font Style (Text Size, Weight, etc.)
var C = xfa.resolveNode("$record.NAME").value;
if (C == 'TEST') {
this.font.size = "40pt";
this.font.weight = "bold";
} else {
this.font.size = "10pt";
this.font.weight = "normal";
}
5. Changing Field Value or Calculating and Displaying New Value
var C = xfa.resolveNode("$record.NAME").value;
if (C == 'TEST')
{ this.rawValue = '123456'; }