Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Why is my script not calculating?

$
0
0

The first event is calculating correctly, but the second event is not.  What is wrong with the script?

 

var A  = Number(this.getField("OriginalAwardedBid").value);

var B  = Number(this.getField("NegFinalPrice").value);

var C  = Number(this.getField("CurrentVolume").value);

var D  = Number(this.getField("Department").value);

var E  = Number(this.getField("Ttl Proj Original Bid").value);

var F  = Number(this.getField("Ttl Proj Final Neg Price").value);                                            

 

 

if ((D== "Field Sourcing", "National Warehouse", "Purchasing") && (A != 0) && (B != 0) && (C != 0))

{

     event.value = (A*C)-(B*C);}

 

 

else

if((D=="Category Management") && (E !=0) && (F !=0))

{

     event.value = (E-F);}

 

 

else

{event.value = "0.00";}


Viewing all articles
Browse latest Browse all 12130

Latest Images

Trending Articles



Latest Images