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

calculation fix for ignoring formula when field is left blank

dean61
Registered: Jun 30 2010
Posts: 5

If I use a Max formula that will always return a positive value such as: Max((NumericField10[1])*.022,20) what do I need to add to the formula or change in the formula so that if no number is entered in the field NumericField10[1] , it puts a zero in the answer field (or preferably leaves it blank) rather than having it use the formula as if a zero was in the field and calculating the answer as 20 (the Max of the two answers.) Thank you.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Is this a LiveCycle form? It looks like you are using FormCalc. If so then you could add this "if" block
if(NumericField10) thenMax((NumericField10)*.022,20)elsenullendif

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

dean61
Registered: Jun 30 2010
Posts: 5
Thom, Worked perfectly - as you knew it would! Thanks for the feedback and for providing a list of learning sources for the future. Dean