Suppose you have money fields (Tuition, Room Cost, Dining Cost) on a screen that need to be totalled and the Total is also displayed on the. Screen. To accomplish this, you could put code like the following in the onChange events of each of the three data entry fields (tuition, room and dining):
That gets a little tedious, however, and especially if you have many data entry fields contributing to the sum and you then have to add an additional field, requiring you to add the onChange event code to your new field plus all the others! So instead you could place the calculation code (the previous snippet) behind the onChange event of the calculated field (in this case, Total), and put the following, never-changing snippet behind every data entry field contributing to the calculated field:
If you do it like this, you only have to update one script. This is a much better way!