Hi Charlie,

Thanks for the response. Yes, I'm trying to loop it (and kind of new
to this). Some of the syntax was derived from examples I found online.

I'm away from that project at the moment but will give it a shot and
get back ASAP.

Thanks!

Matt

On Aug 25, 5:56 pm, Charlie <charlie...@gmail.com> wrote:
> I might be off base here but your recalc function code looks like you are 
> expecting a loop to occur through all of the $("input[name^=module-]")
> I don't think this will occur without using $.each or a "for" loop therefore 
> you won't get any incrementation in "i". Also I've never seen "i=++", more 
> common syntax is "i++" for incrementing "i"
> starting with something like :
> $("input[name^=module-]").each( function(i) {
>        $(this).bind("keyup".....
> will loop through each and add increment to "i" on each loop
> betweenbrain wrote:Hi All, I'm trying to use jquery.calculationto calculate 
> some text inputs versus a selected field. I'm running into an issue with 
> using variables to select information from the same row. Here's what I have 
> so far. Any help would be greatly appreciated: <script 
> type="text/javascript"> $(document).ready( function (){ 
> $("input[name^=module-]").bind("keyup", recalc); 
> $("input[name='input-positions']").bind("click", recalc); recalc(); } ); 
> function recalc(){ var i = $(this)[0].rowIndex; 
> $("[id=total-positions-left]").calc("avail - (used * qty)", { avail: 
> $("[name='input-positions']:checked").val(), used: 
> $("[td.item-qty-pos-reqd'].eq(i)"), qty: $("input[id^='module-qty'].eq(i)") 
> }), i = ++ $("#total-positions-left").text($this.sum() ); } </script>

Reply via email to