Looking for javascript that compares two values and returns value of zero if first is >= 2d
I wish to compare the values of two fields that are calculated based upon the sum of other fields like this:
sum1=fieldx +fieldy+fieldz
sum2=fielda+fieldb+fieldc
if sum1>sum2 then sum2 should display a 0 and if sum2 displays a 0, then fielda+fieldb+fieldc should become invisible only to the user, but still be there since it is a part of theabove equation. so far I have this, but this does not even insert 0 into the field
event.value=this.getField("2ea3").value>=event.value ? this.getField("2eD").value : 0;In the above example I use 2ea3 for sum1 and 2eDfor sum2. When I run it in debugger, it does show a zeo but it does not insert it into the form. I don't know why it is not inserting a zero into the field when the debugger results to 0.
Thanks for your help.

