Need some help to validate an input and dropdown. Both can be empty or both must be filled. If the user forgets to fill the text input in column 5 and select a value from the dropdown in column 6 alert message should appear or if the user forgets to choose from the dropdown in column 6 and fill in the text box in column 5 alert message must also appear. The validation must operate on each created row.
Check jsfiddle here.
I'm thinking something like this:
$('input[name=QtePack]').each(function (obj) {
var $QtePack = $(this).val();
var tr = obj.closest('tr');
var $PackType = tr.find("[id^='Pack_Type_']").val();
if ($QtePack.length > 0 && $PackType == '') {
valid = false;
$PackType.addClass('error');
}
});

Thanks :-)