Hi,
I have an order form with 3 boxes (box1,box2,box3). Numbers or quantities will be put into these boxes(i.e. I want to order 1 of those and 2 of these and they cost $1.50 each). I then need to add up the numbers in those three boxes and multiply it by $1.50. I can get the addition to work but it won't recognize the multiplier. Can anyone help me?
Views
Replies
Total Likes
I would use some thing similar to following JS code in "calcuate" event of the totalCost value goies to .....
if (!box1.isNull && !box2.isNull && !box3.isNull) {
this.rawValue = (box1.rawValue + box2.rawValue + box3.rawValue) * 1.5;
}
Views
Replies
Total Likes
It Worked! But I noticed that if I don't fill in all three boxes it won't calculate. Is there something that needs to be in the code telling it to ignore
the empty boxes? I thought the "isNull" did that...
Views
Replies
Total Likes
Worked perfect! But I noticed that if all the boxes didn't have a number in them, it wouldn't calculate. Do I have to put something into the code to ignore boxes that don't have numbers in them?
You can't imagine how much I appreciate your help - Thank You...
Views
Replies
Total Likes
Yes as you guessed isNull is the magic word that does that.
Let me ask you this .....You want to calculate the value even if one of the three boxes are filled in right?
Let us change the code little bit and find out if it does what you need.....use the following to see it meets your requirement.
if (!box1.isNull || !box2.isNull || !box3.isNull) {
this.rawValue = (box1.rawValue + box2.rawValue + box3.rawValue) * 1.5;
}
Views
Replies
Total Likes
Just what I needed - thank you so much!
Views
Replies
Total Likes