<script type="text/JavaScript">
$(document).ready(function(){
$("#selecctall").change(function(){
<% int j =0; %>
var current = 0;
$.each($("input[name='deferral']"),function(){
if($('#deferral'+current).is(':checked')){
current++;
<% j ++; %>
alert(<%= j %>);
}else{
$('#deferral'+current).prop('checked', true);
<%if(j< rowid.size()){%>
function($(this).val(),'<%= (String)vendor.get(j)%>','<%= (String)invoice.get(j)%>', current)
alert(<%= j %>);
<%}%>
current++;
<% j ++; %>
}
});
});
});
</script>
In above code I tried to increase the value of 'j' but it is not increasing.
otherwise I want to "(String)vendor.get(j)" this function should accept JavaScript variable i.e. 'current',but how can I convert 'current' JavaScript variable into java integer