Hi Rita,
As had been said, in CRM 2011 you can implement this by setting a boolean hidden value on the form and then saving the record. On load you can then have code that fires if that boolean is set to yes (and set it back to no so it does not keep firing).
In CRM 2013 this becomes a bit trickier with their new way of implementing save events. However what will work for both systems, and will be a more reliable way of handling it would be to have your JavaScript set a hidden boolean flag and save the record,
and then have a plugin trigger when that boolean field is saved to do your calculation behind the scenes. This will give you access to the values before and after the update (if necessary). This might be overkill for your specific requirement, but it is always
good to weigh up you're options. :)
Your plugin would also need to set that boolean flag back to no.
~ Atomic Coder