Link to home
Start Free TrialLog in
Avatar of cartereverett
cartereverettFlag for United States of America

asked on

I need an Acrobat JavaScript to manage a combo box, check box and text field.

Hello Experts,

Excuse my question title; I couldn't find a better way to describe what I need.

I have a PDF document with a Combo Box, a Check box and a text field.   On the Combo Box I have the following:

$250,000/$250,000
$500,000/$500,000
$250,000/$500,000
$1,000,000/$1,000,000
$1,000,000/$2,000,000
$2,000,000/$2,000,000
$2,000,000/$3,000,000
$3,000,000/$4,000,000
$4,000,000/$4,000,000
$5,000,000/$5,000,000

If a user select any of the amounts from the combo box and do not check the check box, the text field will be empty.

If $250,000/$250,000 is selected and the check box is checked, the text field has to show "N/A"
If $500,000/$500,000 is selected and the check box is checked, the text field has to show "$500,000"
If $250,000/$500,000 is selected and the check box is checked, the text field has to show "$500,000"
If $1,000,000/$1,000,000 is selected and the check box is checked, the text field has to show "$1,000,000"

The text field has to show $1,000,000 for all the other amounts where there are selected from the combo box and the check box is checked.

Need help ASAP.  Thanks in advance for your help.





sample.pdf
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

How much do you know about JavaScript?
Avatar of cartereverett

ASKER

Almost nothing.  I took some VB .net classes and have the logic, but that's about it.
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One more thing, remove the line with "console.println(comboValue)" from the script above, that was a line to output debug information to the JavaScript console (which you can bring up with Ctrl-J) in Acrobat.
khkremer,

Please check the attach file and tell me what I'm doing wrong.  I corrected the info within the combo box and added the 0 for the export value of the first option of the combo box and did everything else you asked  me to and it doesn't do anything.  Thanks buddy.
sample.pdf
The combo box name in your form contains a space, when you reference that name in the document level javascript, you are using the name without the space, therefore the program cannot find the field. Either remove the space from the actual field name, or add the space to the reference in the program.
I was about to reply letting you know that I found the problem.  Thanks a whole lot for your help.  I might have some more stuff soon :)