Adobe Acrobat: Leave a Calculated Form Field Blank When Scores Are Zero
Question details
Make the SuggestedMethod field stay blank until at least one ranking score is greater than zero, then display the tooltip of the lowest positive score.

- Product
- Adobe Acrobat PDF forms
- Device & OS
- not provided
- Scenario
- A PDF form uses JavaScript to compare a group of RankingScore fields and display the corresponding field tooltip.
- Observed behavior
- When all ranking scores initially contain zero, SuggestedMethod displays the first column's tooltip instead of remaining blank.
Open the PDF in Adobe Acrobat and confirm that the score fields are grouped under RankingScore and the output field is named SuggestedMethod. Check that the score fields have tooltips, because the calculation displays the selected field's tooltip.
Ignore zero scores in the SuggestedMethod calculation
Use a custom calculation script to select the lowest positive score and leave the output blank when no positive score exists.
In Adobe Acrobat, open the PDF and select All tools > Prepare a form.
Double-click the SuggestedMethod field to open its properties. On the Calculate tab, select Custom calculation script and click Edit.
In the JavaScript editor, replace the existing calculation with: var oMinFld = null; this.getField("RankingScore").getArray().forEach(function(oFld) { if (oFld.value > 0 && (!oMinFld || oFld.value < oMinFld.value)) { oMinFld = oFld; } }); event.value = oMinFld ? oMinFld.userName : "";
Close the script editor and field properties, save the PDF, and test the form. With every score set to zero, SuggestedMethod should be blank; enter positive scores to check that it shows the tooltip of the lowest one.

Work with PDF and Office files in WPS Office
WPS Office is a free, lightweight alternative for everyday document work, with a familiar interface and support for PDF and Microsoft Office formats to make migration easier. Use Adobe Acrobat for the custom form calculation described above; WPS Office does not fix Acrobat JavaScript.

Frequently Asked Questions
Why does SuggestedMethod show a value when every score is zero?
The original calculation can select the first field as the minimum even when its value is zero. Add the oFld.value > 0 condition in SuggestedMethod's custom calculation script to exclude zero scores.
Where does the displayed tooltip come from?
The script reads oMinFld.userName, which is the selected field's tooltip. In Prepare a form, open a RankingScore field's properties and check its Tooltip setting.
What happens if two fields have the same lowest positive score?
The script keeps the first matching field returned by the RankingScore array because it replaces the current minimum only when it finds a strictly lower value.
Why might SuggestedMethod not update after a score changes?
In Acrobat preferences, check that automatic form-field calculation is enabled. Also check the field calculation order so the RankingScore fields calculate before SuggestedMethod.




