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

How to show a field value using IF

Registered: Feb 11 2010
Posts: 16

Please help!!!

I have created a form that I need to implement an If Then statement.

If Field A < 0 then Field BB show the content of Field A
If Field A > 0 then Field CC show the content of Field A
If Field A = 0 then Field A, BB, CC show 0

I am new, please help.

Thanks in advance for great help.

Dian

My Product Information:
Acrobat Pro 8.0, Windows
try67
Online
Expert
Registered: Oct 30 2008
Posts: 2399
Field BB custom calc:
a = this.getField("A").valueif (a<=0) {event.value=a;} else event.value = "":

Field CC custom calc:
a = this.getField("A").valueif (a>=0) {event.value = a} else event.value="";

(I've added to the script something that you didn't mention, clearing the fields when the other one is used. I assume that's what you meant to do.)

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Registered: Feb 11 2010
Posts: 16
Thank you Sir. Thank you for the quick answering.

I tried. Here is the result:

FieldBB: it showed me some error. "SyntaxError: invalid label, 4: at line 5
FieldCC: it took the script, but it won't change anything

Please let me know where I did wrong.
try67
Online
Expert
Registered: Oct 30 2008
Posts: 2399
You will need to change the name of field A, depending on how you named it.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Registered: Feb 11 2010
Posts: 16
I don't know how to thank you enough. you are great. It works perfect
Registered: Feb 11 2010
Posts: 16
Please let me know why the IF calculating result is not show after entering numbers. (return key for click anywhere won't let IF result shown) It only shows when a zero added to any blank field.