Hard to help you without a link on this one... I find the description to be very confusing. Nonetheless, here are a couple of problems that jump out at me:
<input name="t1" type="text" onKeyUp="return autocalc(this,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47)" tabindex="1" class="textInput">
First, the jQuery way of binding an event is to use on() for jQuery 1.7 (bind() or delegate() for jQuery 1.6 and below). The onKeyUp inline function call method would be considered poor technique even with plain old JavaScript, and even more so in the jQuery world. Second, what is this t1, t2, t3, ... business? Better to create a wrapped set of all the input boxes, put them in a variable, and sum them with .each();
Something like this:
- $(".textInput").on(
- 'keyup',
- function ( e ) {
- var $inputBoxes = $('.textInput');
- calculateSum($inputBoxes);
- }
- );
Here, every keyup on an input box with class .textInput would create a wrapped set of all the elements with class .textInput (basically all the input boxes). It would then pass this wrapped set to calculateSum(). You'd then use .each() to loop through all these objects, reference the value attribute, and calculate the total.
Hope this helps.