Looks like you are calculating while page is loading, you are supposed to wait until user enter his values? May be you can have a button and let him click it after entering values to show results.
okay, i’m a bit confused on which script should my calculations go? and how to send the total back out to a textfield. any help is appreciated.