You call both functions calcTotal()... you would need to name the functions uniquely to use the looped function declaration like you do. It should be as easy as adding the incremented number to the function name and the onblur event where it is called.