Hello Everybody,
Have a task to populate first column of the table with the data from SQL, then enter data in the next column and finally auto-populate third field with OK if column1 matches column 2
Using different threads I had it running on v 9.0.1 with next code.
$(document).ready(function () {
$('#Field8').trigger('change');
function fillColumn() {
if ($('tbody tr').length > 1) {
return;
} else {
var resultNumber = $('.filledField').find('option').size();
for (var i = 1; i < resultNumber; i++){
k = i + 1;
$('tr:contains("Req ' + i + '")').find($('.currentValue input')).val($('.filledField').find('option:nth-child(' + k + ')').text());
$('tr:contains("Req ' + i + '")').find($('.result input')).val('');
if (i != resultNumber - 1) {
$('#q10').trigger('click');
}
$('.currentValue input').attr('readonly', 'true');
$('.result input').attr('readonly', 'true');
$('#q10').hide();
}
}
}
$('.filledField select').change(fillColumn);
$('#q8').hide();
// $('#q14').hide();
$('.cf-table-block').change(grabVal)
function grabVal() {
$('.cf-table-block tbody tr').each(function () {
if ($(this).find('.fileID input').val() == $(this).find('.currentValue input').val())
$(this).find('.result input').val('OK');
});
}
});
However on v 9.1.1 it does not auto-populate first column until value in dropdown field selected (sql request returns 3 values but by some reason dropdown menu has one empty line on top).
Is there something I'm missing?
Thank you,