$('#btnSelectAll').click(function() {
$('.inputchbox').attr('checked', true);
$('fieldset').find('img').hide(); // datepicker hide
});
//Cancel will deselect all checkboxes and hide submit and Cancel Buttons
$('#btnCancel').click(function() {
$('.inputchbox').attr('checked', false);
$('fieldset').find('img').show(); //datepicker show
});
This is my selectAll and cancelall click events..its working good..
other then this On individual selection on checkbox
$(".inputchbox").change(function() {
if ($('.inputchbox').is(':checked')) {
$(this).closest("fieldset").find('img').hide(); // Datepicker hide
}
else {
$(this).closest("fieldset").find('img').show(); // datepicker show
}
});
</script>
on selctAll and cancelall i can show and hide my all datepicker image in my fieldset
on individual selction of checkbox is also working good.
my problem is..
when I selectAll i can hide all my datepicker image after doing is..
if do Individually on my each checkbox box to show my Image its not working and not even going in to else condition on checkbox selection?
is that anything doing wrong
thanks
Right off the bat, I think you want to change the if statement to use $(this) instead of the class selector .inputchbox, that should at least get your else to trigger