Validation for all by checkbox not working
I have a table with a checkbox in the first <td>, now i want to check only
those <tr> where the check boxes are checked.
<table>
<tr>
<th style="width: 5%;">Select</th>
<th style="width: 5%;">ID</th>
<th style="width: 10%;">Name</th>
<th style="width: 5%;">Order</th>
<th style="width: 5%;">Price</th>
</tr>
<c:forEach var="pack" items="${PackList}" varStatus="rowCounter">
<tr class="allPackClass">
<td class="selective_CatCreation"><input type="checkbox"
name="packIdCatCreate" value="${pack.packId}"></td>
<td>${pack.packId}</td>
<td>${pack.name}</td>
<td><input type="text" name="packDisOrder" disabled="disabled"
style="width: 20px;" value=""></td>
<td><input type="text" name="packPrice" disabled="disabled"
style="width: 20px;" value=""></td>
</tr>
</c:forEach>
</table>
validation -->
$("tr.allPackClass").each(function() {
if($(this).is(":checked")== true){
if($(this).closest('tr').find('input:text').val() == ""){
$("#validationDiv_").html("<span
style='font-size:12px;color:red;'>Fileds are
missing</span>");
return false;
}
}
});
Please help, where i am doing wrong
No comments:
Post a Comment