Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

DEPENDENT COLUMNS OF ANOTHER

  • FERNANDA1206
  • FERNANDA1206's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 1 week ago - 5 years 1 week ago #181750 by FERNANDA1206
DEPENDENT COLUMNS OF ANOTHER was created by FERNANDA1206
Hi,

I have a matrix with different response types in its rows but I would like column 5 to depend on column 4, that is, if it has the value of 1, the field to write the value is enabled, I have the following code but I have already modified it and does not allow me....
They could help me..

var showValue = '1';
$('.answer-item.answer_cell_SQ005 select', thisQuestion).on('change', function(e) {
var thisValue = $(this).val();
var thisCode = $(this).closest('.answer-item').find('input:text').attr('id').split('_')[1];
var otherInput = $('.answer-item.answer_cell_SQ006'+thisCode+' input:text', thisQuestion);
if(thisValue == showValue) {
$(otherInput).show();
}
else {
$(otherInput).hide().val('');
checkconditions($(otherInput).val(), $(otherInput).attr('name'), 'text');
}
});
// Initial states of row-4 inputs
$('.answer-item.answer_cell_SQ006 input:text', thisQuestion).hide();
$('.answer-item.answer_cell_SQ005 .inserted-select', thisQuestion).each(function(i) {
var thisValue = $(this).val();
var thisCode = $(this).closest('.answer-item').find('input:text').attr('id').split('_')[1];
var otherInput = $('.answer-item.answer_cell_SQ006'+thisCode+' input:text', thisQuestion);
if(thisValue == showValue) {
$('.answer-item.answer_cell_SQ006'+thisCode+' input:text', thisQuestion).show();
}
});
Last edit: 5 years 1 week ago by FERNANDA1206. Reason: Because I add the matrix example
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose