Level 1

0% to

Level 2

Tip /

to gain points, level up, and earn exciting badges like the new
Mission!

View all

SOLVED

## JavaScript Sum Help

Level 3

Hi Folks,

I have a LiveCycle purchase request form that calculates a grand total. If that grand total is equal to or greater than \$1,000.00 the subform "comparativeBids" should be made visible. The calculation works fine in FormCalc but not in JavaScript. Can someone help me figure how to make the JavaScript calculation work? I am not familiar with FormCalc enough to write conditional statements using that language but I am open to using it is someone can provide the script.

Anyway, here is my JavaScript for grandTotal (calculate event):

PRForm.generalInfo.totalGroup.totalTable.grandTotalRow.grandTotal::calculate - (JavaScript, client)

this.rawValue = subtotalRow.subtotal + taxRow.tax + shippingRow.shipping;

comparativeBids.presence = "hidden";

var order= xfa.resolveNode("PRForm.generalInfo.totalGroup.totalTable.grandTotalRow.grandTotal").rawValue;

if (order >= 1000) {

comparativeBids.presence = "visible";

}

Note: I have also tried the calculation as this.rawValue = subtotalRow.subtotal.rawValue + taxRow.tax.rawValue + shippingRow.shipping.rawValue; --- again no success with the JavaScript version.

Thanks in advance for the help!

1 Accepted Solution
Level 7

Well in formcalc the if statement would be:

if (\$ >= 1000) then

comparativeBids.presence = "visible"

else
comparativeBids.presence = "hidden"

endif

0 Replies
Level 7

Well in formcalc the if statement would be:

if (\$ >= 1000) then

comparativeBids.presence = "visible"

else
comparativeBids.presence = "hidden"

endif

Level 3

Thanks. The conclusion of my form was that the sum line + the show/hide condition don't work when assigned to the same field. So I assigned the condition whyisthisme to an invisible text field and now all works fine. Thanks for the help.