kurtjaipur
New Member
Can anyone help me out please. I am having an image holding a check box. Like this I am having 4images with with 4 check boxes. If am selecting all the check boxes only I want to navigate to a new page directly.if user clicked a single checkbox then the page should not redirect to the new pageif user clicked "select all" or if user selects all the check boxes one by one also the page should redirect to the new page.Can any one please help me out and do the needful.HTML\[code\] <table border="1"> <tr> <th><input type="checkbox" id="selectall"/></th> </tr> <tr> <td align="center"><input type="checkbox" class="case" name="case" value="http://stackoverflow.com/questions/11537728/4"/></td> <td align="center"><img src="http://stackoverflow.com/questions/11537728/images/1.jpg" /></td> </tr> <tr> <td align="center"><input type="checkbox" class="case" name="case" value="http://stackoverflow.com/questions/11537728/4"/></td> <td align="center"><img src="http://stackoverflow.com/questions/11537728/images/2.jpg" /></td> </tr> <tr> <td align="center"><input type="checkbox" class="case" name="case" value="http://stackoverflow.com/questions/11537728/4"/></td> <td align="center"><img src="http://stackoverflow.com/questions/11537728/images/3.jpg" /></td> </tr> <tr> <td align="center"><input type="checkbox" class="case" name="case" value="http://stackoverflow.com/questions/11537728/4"/></td> <td align="center"><img src="http://stackoverflow.com/questions/11537728/images/4.jpg" /></td> </tr> </table>\[/code\]JS$(function(){\[code\]// add multiple select / deselect functionality$("#selectall").click(function () { $('.case').attr('checked', this.checked);});$(".case").click(function(){ if($(".case").length == $(".case:checked").length) { $("#selectall").attr("checked", "checked"); } else { $("#selectall").removeAttr("checked"); }});\[/code\]});