I am unable to check the checkbox only if I click on the row but I want to click it in both ways.
This is my method i am using:
$("table tr").click(function(){
var id=$(this).attr("id");
//This is because i dont want first row to be able to select
if(typeof(id)!="undefined"){
if($("#select-"+id).attr("checked")!="checked")
$("#select-"+id).attr("checked","checked");
else
$("#select-"+id).removeAttr("checked");
}
});
Also here you can live view it sabrio.eu5.org/admin.php
username: admin
password: admin
My best guess is that your TR click function is cancelling out the default behaviour of the checkbox being clicked. So when you click the checkbox it is like it is being clicked twice.
try adding a click event to you checkboxes like this…
you will need to change the selector to something that suits your html
See here for a working example