Please help me with this issue:
There are an undetermined number of iterations in this set of code:
var c = 1;
for(c=1; c<x; c++){
$('#'+l_id+'_'+c).on("keypress", function(f){
com_guide_add_li((c+1), $(this).parent().parent().attr('id'), f);
})
}
The problem, is that when the event is called, the (c+1) is the value of the last iteration + 1, not the value that it was somewhere during the iterations when this code ran.
How can I ensure that the original value of the (c+1) remains in the function call, ie that value that it was when the iterations to set the event call ran?
Thanks
*sorry for the long title