My HTMl:
<input type="checkbox" name="subjects[0]" class="checkbox_array" value="1" />
<input type="checkbox" name="subjects[1]" class="checkbox_array" value="1" />
<input type="checkbox" name="subjects[2]" class="checkbox_array" value="1" />
<input type="checkbox" name="subjects[3]" class="checkbox_array" value="1" />
<input type="button" id="ss" />
jquery:
$("#ss").click(function(){
if($('input[name=subjects\\[\\]]:checked').length<=0)
{
alert("No radio checked")
}
});
its not working for me... using class if($('.checkbox_array:checked').length<=0) it work that easy but how can i do with input name selector
name="subjects[]"-- if you're using PHP server-side, it will build an array for you automatically.classselector? It's more semantic, and probably quicker.