These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Validate a sum

vpd85
Registered: Mar 19 2009
Posts: 39

How can I validate an amount, so that in the moment that the this amount exceeds the value of 100 , the respective field displays an error message.
Example:
field1+field2+filed3+field4= <100 display the value
field1+field2+filed3+field4= >100 display the error message

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
You can use the following FormCalc in the "Validation" action:

if($.rawValue <= 100 or $.rawValue eq null) then// less than or equal to 1001else// greater than 1000xfa.host.messageBox("Can not exceed 100")endif

or include the test and message in the "Calculation action.

George Kaiser

vpd85
Registered: Mar 19 2009
Posts: 39
gkaiseril wrote:
You can use the following FormCalc in the "Validation" action:
if($.rawValue <= 100 or $.rawValue eq null) then// less than or equal to 1001else// greater than 1000xfa.host.messageBox("Can not exceed 100")endif

or include the test and message in the "Calculation action.
Its ok, but I would like the error message to appear in the field, not as pop-up.

Thanks!
nicholsx
Registered: Dec 9 2010
Posts: 2
what if y ou just want a calculated field to display 100 if the calculation for that field exceeds 100?

NOV ReedHycalog

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Compute the sum and then use the 'if' statement to test if the value is greater than 100.

George Kaiser