I am trying to get a form to show a zero if the number subtracted results in a negative.
ie $100 - $200 = $0
Please help the scripting afflicted.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
The script in the calculate event of the numeric field would need an if/else statement. For example (using JavaScript):
var nAns = NumericField1.rawValue - NumericField2.rawValue;
if (nAns >= 0) {
this.rawValue = nAns;
}
else {
this.rawValue = 0;
}
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
The script in the calculate event of the numeric field would need an if/else statement. For example (using JavaScript):
var nAns = NumericField1.rawValue - NumericField2.rawValue;
if (nAns >= 0) {
this.rawValue = nAns;
}
else {
this.rawValue = 0;
}
Hope that helps,
Niall
Views
Replies
Total Likes
Correct as always. Thanks, Niall.
I have little scraps of paper with your scripts on them taped all over the walls of my office. They always did think I was strange here.
Your friend, Cake Diva
Views
Replies
Total Likes
...I'll just have to turn those scraps into a book!
Views
Replies
Total Likes
I'd buy it!!!!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies