i have a table with input in all of rows, i need to check if all input are filled with values I tried to use the selector $("[id$='txtBarcode']") to select all input that ends with txtBarcode, but it not seems to work. what is wrong?
$(document).ready(function() {
$("#cmdConferma").click(function() {
AllFilled();
});
});
function AllFilled() {
$("[id$='txtBarcode']").each(function() {
$this = $(this);
// var value = $("[id$='txtBarcode']").value();
if ($this.value() == '') {
return confirm('are you sure to exit without fill?');
}
});
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table class="table_style" cellspacing="0" rules="all" border="1" id="dgrRighe" style="width:100%;border-collapse:collapse;">
<tr>
<td>
<input name="dgrRighe$ctl02$txtBarcode" type="text" value="1" id="dgrRighe_ctl02_txtBarcode" />
</td>
<td>
<input name="dgrRighe$ctl03$txtBarcode" type="text" id="dgrRighe_ctl03_txtBarcode" />
</td>
<td>
<input name="dgrRighe$ctl04$txtBarcode" type="text" id="dgrRighe_ctl04_txtBarcode" />
</td>
</tr>
</table>
<input type="submit" name="cmdConferma" value="exit" id="cmdConferma" class="button" />