Have table with dropdowns with each row, need to validate if any dropdown selected columns are Blank or undefined, need to restrict the validations. Tried with below code but failed, please suggest me the issue.
let selectedDropdownVals = $('#firstTable input[type="checkbox"]:checked')
.closest('tr')
.find('select')
.val();
// const checkBoxLen = this.persons.filter(f => f.checked);
const checkBoxLen = $('#firstTable input[type="checkbox"]:checked');
alert(checkBoxLen.length);
for (let i = 0; i < checkBoxLen.length; i++) {
if (
selectedDropdownVals[i] == '' ||
selectedDropdownVals[i] == undefined ||
selectedDropdownVals[i] == null ||
selectedDropdownVals[i] == 'Blank'
) {
alert('Please select correct dropdown option for proceeding!!!');
return false;
} else {
alert('Data is validated, no issues found');
}
}