I have a table in which I have 2 textboxes & a button and I want to disable the button if any of the textboxes are empty.
I have used the following jquery to do so -
$(document).ready(function () {
var rdata = $('.chcktbl5').attr("id");
$('#txtwifiuserid_' + rdata).keyup(function () {
if ($(this).val().length != 0 && $('#txtwifipass_' + rdata).val().length != 0)
$('#btnSendSMS').attr('disabled', false);
else
$('#btnSendSMS').attr('disabled', true);
})
$('#txtwifipass_' + rdata).keyup(function () {
if ($(this).val().length != 0 && $('#txtwifiuserid_' + rdata).val().length != 0)
$('#btnSendSMS').attr('disabled', false);
else
$('#btnSendSMS').attr('disabled', true);
})
});
But the problem I am having is that this is only working for the first record of the table, not for all the records.
So, what should I do instead to do this thing for all the records of the table?