Level 1

0% to

Level 2

Tip /

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

View all

## form logic calculation

ryanr68196603
Level 1

Likes

0 likes

Total Posts

2 posts

0 solutions
View profile

ryanr68196603
Level 1

Likes

0 likes

Total Posts

2 posts

0 solutions
View profile
ryanr68196603
Level 1

21-03-2018

Upfront,  I'm an Adobe Noob.  I can stumble my way through most of the things I do not know how to do but I am stuck on this one.

The situation.   I have a form that includes filled by the user.  These fields are "Purchase Price", "Less Concessions", "Less Home Warranty",  "LAComm" & "BAComm".    All are numbers.  I also have a drop down box where the user selects "Commission Based On:" and their choices are "Net" or "Gross".   Once the user inputs Purchase Price, Less Concessions & Less Home Warranty I have the form calculate the ""NetPurPrice".  That is easy.

The Problem.   I have two fields that need a logical calculation.  "BuyComDue" & "ListComDue".  If the user selects Net from the drop down menu the "ComDue"s are based off of the NetPurPrice.  And obviously if the user selects Gross then we base the "ComDue"s on the PurchsePrice.

So how do I make the form do the following:

IF "Commision Based On" = Gross

THEN "BuyComDue" = "PurchasePrice" x "BAComm"

AND   "ListComDue" = "PurchasePrice" x "LAComm"

ELSE

AND   "ListComDue" = "NetPurPrice" x "LAComm"

SideNote:   Currently to get my NetPurPrice the user is forced to enter a negative value in "LessConcessions" & "Less Home Warranty".  I have the form forcing a neg. number using validation.  It works but I would like to make the form do subtraction vs. adding neg. numbers to reach my goal.  It would seem more user friendly.

Thank you for any and all assistance you provide.

#### Accepted Solutions (0)

Thom_Parker
Level 3

Likes

5 likes

Total Posts

90 posts

2 solutions
View profile

Thom_Parker
Level 3

Likes

5 likes

Total Posts

90 posts

2 solutions
View profile
Thom_Parker
Level 3

21-03-2018

Is your form a LiveCycle Form?

try67
Level 2

Likes

14 likes

Total Posts

120 posts

1 solution
View profile

try67
Level 2

Likes

14 likes

Total Posts

120 posts

1 solution
View profile
try67
Level 2

21-03-2018

That is not how you access fields' values. Read the last part of the second tutorial I linked to.

Also, it's not how you write the JavaScript code. JS is case-sensitive. So you have to use "if", not "IF", and "else", not "ELSE", etc.

ryanr68196603
Level 1

Likes

0 likes

Total Posts

2 posts

0 solutions
View profile

ryanr68196603
Level 1

Likes

0 likes

Total Posts

2 posts

0 solutions
View profile
ryanr68196603
Level 1

21-03-2018

That is sort of what I figured. but using the following....

IF ( CommBase = Gross ) BuyComDue = PurchasePrice * BAComm

ELSE BuyComDue = NetPurPrice * BAComm

SyntaxError: missing ; before statement

1: at line 2

I have tried everything.

try67
Level 2

Likes

14 likes

Total Posts

120 posts

1 solution
View profile

try67
Level 2

Likes

14 likes

Total Posts

120 posts

1 solution
View profile
try67
Level 2

21-03-2018

try67
Level 2

Likes

14 likes

Total Posts

120 posts

1 solution
View profile

try67
Level 2

Likes

14 likes

Total Posts

120 posts