Copy link to clipboard
Copied
Right now I have the following script in my form:
//</ACRO_script>
//</AcroForm>
//<AcroForm>
//<ACRO_source>AreaDuesQty:Calculate</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:AreaDuesQty:Calculate ***********/
var A = +this.getField("ChptTotQty").value;
var B = +this.getField("AffTotQty").value;
if( A > 0 ) event.value = A + B;
else event.value = "";
It works great as long as there is a number in the "ChptTotQty" But, I want it to give me a number whether there is a number in "ChptTotQty" or "AffTotQty" field. Is there a way to make "if ( A > 0 ) event.value = A + B;" Into "if ( A > 0 ) or ( B > 0 ) event.value = A + B;"
Any help would be greatly appreciated.
Thank You
Copy link to clipboard
Copied
I am so sorry, I found this answer in one of my earlier questions.
I have two variables A & B. I want to say "if( A or B > 0 ) event.value = A + B"
I am hoping that the link above will take you to the answer when you click on it. I am not sure it will work.
Chris
Copy link to clipboard
Copied
Try this code:
var A = this.getField("ChptTotQty").value;
var B = this.getField("AffTotQty").value;
if( A > 0 || B>0 ) {
event.value = A + B;
}
else {
event.value = "";
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now