Copy link to clipboard
Copied
Field name: box1, box2, box3
Box3= smaller number box1 or box2 multilply by 0.3489.
How to write the script for box3 please?
Copy link to clipboard
Copied
Please be more specific, what do you mean by smaller number? And what do you mean by "box"; a textfield object? a dropdown menu object? a listbox?
Did you mean to ask that you're looking for someone to write a script for you and with that code be able to evaluate which texfield has a value greater than the other field's value?
And whichever value is not greater than the other then multiply by 0.3489 and display that tesult in a third textfield?
Where do you need this event to execute from? Do you want to run the code as a custom calculation script in the third texfeld where the total value will be displayed?
Are you goin to run the code as a mouse-up event from clicking on a button?
Are there other fields' events interacting with the total that will be displayed in that third field object?
Please clarify.
Copy link to clipboard
Copied
Multiply the smaller of box1 or box2 by 0.3489
Try67 got it thanks!!!
Copy link to clipboard
Copied
Use this code as the custom calculation script of "box3":
var v1 = Number(this.getField("box1").valueAsString);
var v2 = Number(this.getField("box2").valueAsString);
event.value = Math.min(v1,v2) * 0.3489;
Copy link to clipboard
Copied
It works thanks!!!