DEPENDENT COLUMNS OF ANOTHER

Plus d'informations
il y a 5 mois 2 jours - il y a 5 mois 2 jours #181750 par 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();
}
});
Pièces jointes :
Dernière édition: il y a 5 mois 2 jours par FERNANDA1206. Raison: Because I add the matrix example

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!