[jQuery] Variable in :eq() with jquery.calculation
Hi All,
I'm trying to use jquery.calculation to 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>