Question Details

avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

If Statement

I am converting an excel form into a pdf form and am trying to duplicate an 'if' statement used in the excel form. the initial value im using comes from a text field called 'aa', I want the calculated value to be placed into a text fields called 'bb'.

i have created both text fields, opened up the properties for text field 'bb' and in the calculate tab selected 'custom calculation script'. This is the code:

var z = this.getField("aa").value;

if (z<=0)
{
bb.value = z*0.0575;
}
else
if (z>0)
{
bb.value = z*0.0475;
}

i cant find anything wrong with the code, but for some reason the final value (bb.value) doesnt get displayed in the 'bb' text field on the form. It just remains blank. Any help would be appreciated!

Also, i am using Adobe Acrobat X Standard


Daniel Blickling 773 days ago


3 Answers

avatar
<p>Congratulations! The Acrobat User Community selection team has approved your status as Expert in the Acrobat User Community. We appreciate all your past contributions and hope you will continue to support the community by answering questions and participating in the Acrobat Answers Q&A program as you've done in the past.</p>

<p>As an expert, you will get a badge to display on your profile with the level EXPERT next to your name and you have become eligible to be nominated to the Adobe Community Professional Program.</p>

<p>After reviewing the Adobe Community Professional Program information at https://www.adobe.com/communities/professionals/, please let us know if you are interested.</p>

<p>Someone from the selection team will contact you soon regarding the community professional program. Keep up the good work!</p>

<p>Regards,</p>

<p>The Acrobat User Community Team</p>


<p>**** Disclosure Requirements for Endorsements Received by Third Parties  ****</p>

<p>If you endorse or refer people to the Acrobat User Community in any venue,  it is our responsibility to ensure that you are aware of required compliance with the <a href="http://ftc.gov/os/2009/10/091005revisedendorsementguides.pdf">FTC’s Guidelines</a>. Both you and Adobe can be held liable under federal law for making unsubstantiated claims and for not disclosing your relationship with Adobe. In particular:</p>

<ol>
<li>Always disclose if you have received any type of incentive – free products, promotional items, travel, gifts, payment, and so on from Adobe. The disclosure must be on the same page as the endorsement.</li>
<li>Be truthful. Endorsements should not be misleading. Never make unsubstantiated or exaggerated claims about the benefits of Adobe products or programs. Any statements or endorsements about an Adobe product must be based on upon your actual experience.</li>
</ol>

Thank you again for your support of Adobe and the Acrobat User Community</p>

Replace all instances of "bb.value" with "event.value".


Gilad D (try67) answered 773 days ago  |   Comments (0)  |  New Comment

avatar

  |   Report
Was this answer helpful?  
1
0

avatar
<p>Congratulations! The Acrobat User Community selection team has approved your status as Expert in the Acrobat User Community. We appreciate all your past contributions and hope you will continue to support the community by answering questions and participating in the Acrobat Answers Q&A program as you've done in the past.</p>

<p>As an expert, you will get a badge to display on your profile with the level EXPERT next to your name and you have become eligible to be nominated to the Adobe Community Professional Program.</p>

<p>After reviewing the Adobe Community Professional Program information at https://www.adobe.com/communities/professionals/, please let us know if you are interested.</p>

<p>Someone from the selection team will contact you soon regarding the community professional program. Keep up the good work!</p>

<p>Regards,</p>

<p>The Acrobat User Community Team</p>


<p>**** Disclosure Requirements for Endorsements Received by Third Parties  ****</p>

<p>If you endorse or refer people to the Acrobat User Community in any venue,  it is our responsibility to ensure that you are aware of required compliance with the <a href="http://ftc.gov/os/2009/10/091005revisedendorsementguides.pdf">FTC’s Guidelines</a>. Both you and Adobe can be held liable under federal law for making unsubstantiated claims and for not disclosing your relationship with Adobe. In particular:</p>

<ol>
<li>Always disclose if you have received any type of incentive – free products, promotional items, travel, gifts, payment, and so on from Adobe. The disclosure must be on the same page as the endorsement.</li>
<li>Be truthful. Endorsements should not be misleading. Never make unsubstantiated or exaggerated claims about the benefits of Adobe products or programs. Any statements or endorsements about an Adobe product must be based on upon your actual experience.</li>
</ol>

Thank you again for your support of Adobe and the Acrobat User Community</p>

Where has be "bb" object been established?

If you are trying to access the field in which an action is located, one usually uses the "event" object.

Also if a value is not less than or equal to zero it is then greater than zero.

You can use the following script for the custom calculation script for the field "bb":

var z = this.getField("aa").value;

if (z <= 0) {
event.value = z * 0.0575;
} else {
event.value = z * 0.0475;
}

If you open the JavaScript console you should see an error about "bb" not being defined.


George Kaiser answered 773 days ago  |   Comments (1)  |  New Comment

avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

great thanks!! :D

Daniel Blickling Commented 773 days ago  |   Report


avatar

  |   Report
Was this answer helpful?  
1
1

avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

var z = this.getField("aa")

if (z .value<=0)
{
bb.value = z .value*0.0575;
}
else
if (z .value>0)
{
bb.value = z .value*0.0475;
}


R Rios answered 768 days ago  |   Comments (1)  |  New Comment

avatar
Welcome to the Acrobat Answers site. You're on your way! It won't take you many more points to reach the next level: Participant. And as you accumulate more points, you're also building your reputation with the community and with AcrobatUsers.com.

Using bb.value, I get error message bb not defined.
How do I define bb?
Expert, If I use event.value, how do I transfer this to bb?

Ian Wilson Commented 611 days ago  |   Report


avatar

  |   Report
Was this answer helpful?  
0
1


Download
Acrobat XI trial

Get the trial now


Other Questions Needing Answers