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

Display text box based on contents of several drop-down lists

JoeyJoeJoe
Registered: Mar 19 2007
Posts: 8

How do I display a text field based on the sum of several combo box tools?
 
I set several combo boxes with two values, PASS (export value = 0) and FAIL (export value = 1). I have summed these values to another text box and set it to hidden. I would like another text box to appear only if the sum of the combo box values > 0 (meaning that one of the combo boxes resulted in a FAIL).
 
This is probably insanely simple, but I have no JavaScript experience.
 
I am using Acrobat 6.0.2 and the tools in the 'Advanced Editing' toolbar.
 
Thanks,
JM

My Product Information:
Acrobat Pro 6.0.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is very simple, but the exact implimentation depends of the forms technology you'r using, AcroForms or LiveCycle.

Basically you set the field's visibility by testing the value of the hidden sum field. Use the calculation event for the field you want to make hidden/visible.

//Calculation script
var bVis = (this.getField("sumField").value > 0);event.target.display = bVis?display.visble:display.hidden;

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