I know how to see if an individual checkbox is selected or not.
But Im having trouble with the following - given a form id I need to see if any of the check
This is the best way to solve this problem.
if($("#checkbox").is(":checked")){
// Do something here /////
};
Rahul's answer is best fit for your question. Anyway, if you have a group of checkboxes to be checked and not all the checkbox in your form, you can go for it.
Put a classname for all the checkboxes you want to check, say for example, a classname test_check
and now you can check if any of the checkbox is checked belonging to the group by:
$("#formID .test_check:checked").length > 0
If it returns true
, assume that one or more checkboxes are checked having the classname test_check
and none checked if returns false
.
Hope it helps someone. Thanks :)-