Hi i am writing a php based code in which i am generating checkbox with different id and name
<input type="checkbox" name="settle_check[]" id="settle_check['.$res2['id'].']" value="1" onclick="calculate_discount(\''.$res2['id'].'\');"/>
and my function of calculate discount is as follow
function calculate_discount(id){
alert($('#settle_check['+id+']').val());
if($('#settle_check['+id+']').is(":checked")){
alert('Hiii');
}
else{
alert('Byeee');
}
}
now for every time it is not capturing the value and giving alert of undefined. Please Help me.