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

If then calculaton

Mnainsheet
Registered: Feb 25 2008
Posts: 2

I'm trying to make a pdf document that calculates student financial aid loan eligibility for Veteran students. I am able to do it in excel using the following formula in cell C20: =IF(C21<0,0,C21) but I can't figure it out in Acrobat 7 Professional.

This is where I have been trying to make it work. Under the calculate tab of Text Field Properties, I've tried several formulas to no avail. I've named the Text cells the same as my Excel document. I've been placing my calculation formula in Text Field C20 of the "Simplified Field Notation:"

if(C21<0)
then=(0)
else=(C21)
endif

Any help would be greatly appreciated!

Paul

My Product Information:
Acrobat Pro 6.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
In Acrobat forms and LiveCycle Designer JavaScript the syntax for the "if then else" statement is:

if(statement) {
\\block of code
}
else {
//optional else block of code
}


In LiveCycle Designer FormCalc the syntax is:

if (statement) then
// block of code
else
// optional else or elseif
endif

Simplified field calculations do not support any of the flow control statements, or JavaScript function calls or object methods. You will have to use the "Custom calculation script".

if(this.getField("C21").value < 0) {
event.value = 0;
}
else {
event.value = this.getField("C21").value;
}


Documentation available from Adobe:

Acrobat SDK; http://www.adobe.com/devnet/acrobat/
Acrobat JavaScript Documentation: http://www.adobe.com/devnet/acrobat/javascript.php
Acrobat FDF Toolkit: http://www.adobe.com/devnet/acrobat/fdftoolkit.php
PDF Reference: http://www.adobe.com/devnet/pdf/pdf_reference.php

The above sites include additional links to other PDF information.

Books:
Adobe Acrobat Bible series by Ted Padova
Adobe Acrobat Tips and Tricks by Donna L. Baker
Extending Acrobat Forms with JavaScirpt by John Deubert
Creating Dynamic Forms with Adobe LiveCycle Designer by J. P. Terry

Adobe Sponsored forums:
Acrobat User-to-User forums: http://www.adobeforums.com/cgi-bin/webx/.3bbeda8b/
Acrobat User Community: http://www.acrobatusers.com/

Other Forums:
Planet PDF Forums: http://forum.planetpdf.com/wb/default.asp

Other PDF Sites:
Planet PDF: http://www.planetpdf.com/
Windjack Solutions: http://www.windjack.com/
Ted's Homepage: http://www.west.net/~ted
Abracadabra PDF: http://www.abracadabrapdf.net/index.php?lng=en
NitroPDF: http://www.nitropdf.com/index.asp
D. P. Story (Acrotex): http://www.acrotex.net.
PDF Zone: http://www.pdfzone.com/

JavaScirpt:
JavaScript Central: http://devedge-temp.mozilla.org/central/javascript/index_en.php

George Kaiser