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

I am trying to custom script a field to remain blank if value is zero.

mgdehart
Registered: Aug 4 2010
Posts: 5

I am trying to come up with a custom script for a fillable pdf form that would allow for the field to remain blank if either of the two fields being multiplied are blank. It also needs to be in currency format.

For Field "00Row1_2":

="QtyRow1" * "00Row1"
// end non-blank sum AFNumber_Format(2, 0, 0, 0, "$", TRUE)

if "QtyRow1" is blank then "00Row1_2" should be blank

if "00Row1" is blank then "00Row1_2" should be blank

if ="QtyRow1" and "00Row1" have values then their product should be displyed in "00Row1_2" as a dollar value.

Thank you for any help you can give.

My Product Information:
Acrobat Pro 9.3, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
I have found using the custom validation script can do this no matter what method you use for the calculation, but you will need to force the form to recalculate after you enter the code to see the result.

[url=http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=1714]Total of a sum to return a blank value rather than zero[/url]

And yes, you can copy the code into your custom calculation script if needed.

George Kaiser

mgdehart
Registered: Aug 4 2010
Posts: 5
Your code worked but it won't work when I add in the script for it being formated as currency. Any thoughts?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
The you could look at setting the font color, hiding the field. The value of the field is null, but the use of a currency symbol is added as part of the format.

You are aware that the script you are trying to use has very little documentation and it will not work for a user with Reader.

George Kaiser