Here, I have multiple records with checkboxes. Once I submit, it gives and error as I have created that "you have to select atlease one checkbox". When I select on "select all" checkbox, It will select checkbox all page of checkbox in pagination. But when I unchecked checkbox of particular page and others are checked, it also gives me an error to select checkbox when I submit. So where I am going wrong in this checkbox validation with pagination?
My code:
$('#processorder').click(function() {
checked = $("input[type=checkbox]:checked").length;
if(!checked) {
alert("Please select an Order(s)..!!");
return false;
}
});
});
<div style="text-align: center;margin-bottom: 10px;"><input type="submit" id="processorder" name="processorder" value="Process Order" class="submit-green"/></div>
Aucun commentaire:
Enregistrer un commentaire