Trouble with Displaying Button
Hello!
I am running into issues and I can't seem to figure out why.
I'll try to write this simply... I am working on a paperwork package for a dealership to handle multiple vehicles sold at once. I have a couple line items that are divided evenly amongst all vehicles sold. If it is NOT able to be divided evenly, the remainder is calculated and added or deducted from the first vehicle sold. That is all working just fine. My problem is here... If the item is not divided evenly, a warning icon appears next to the line. This is the function I have written:
function warning(TotalField,PerField)
{
var PerName = event.target.name
var PerRounded = round(PerField,2);
var Count = this.getField("SOLD_COUNT").value;
var Offset = PerRounded * Count;
if ((Offset == TotalField) || (Offset == 0))
this.getField("WARNING_" + PerName).display = display.hidden
else
this.getField("WARNING_" + PerName).display = display.visible
}
The function seems to be working backwards. I want the icon to appear ONLY when Offset does not equal TotalField, but it appears when they are equal and disappears when they are not.
Any ideas??
