Block columns on Side by Side question based on previous column answers
I have a Side by Side question as shown below. Do y’all know how I make it so that ‘Cannot rate’ (column 9) is the only selection that can be made if ‘Not started’ (column 1) is selected?
I tried to mirror in some way the JavaScript shown in the answer in the post below, but I cannot figure out how to get it to work.
Page 1 / 1
@happychuck77 You can use this code (not apply to simple layout)
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("tr.Choice").each(function() { var row = jQuery(this);
var notStartedRadio = row.find("inputtname*='1']:radioovalue='1']"); var cannotRateRadio = row.find("inputtname*='2']:radioovalue='6']");
cannotRateRadio.closest("td").hide();
notStartedRadio.change(function() { if (this.checked) {
Hmm. Thanks, @Nam Nguyen, but that didn’t quite work. See the end result:
Hmm. Thanks, @Nam Nguyen, but that didn’t quite work. See the end result:
@happychuck77 Your statements have displaylogic and youre not showing it, how can you test it if it’s not showing? Here’s my side
A-ha! You are exactly right, @Nam Nguyen! I had some Display Logic that was throwing things off.
So we are closer but not exactly right. As shown in the image below, the ‘Cannot rate’ column radio buttons are not there by default and do show up if ‘Not started’ is selected. However, I need it so all radio buttons are there by default...and if ‘Not started’ is selected, then ‘Extremely rough,’ ‘Somewhat rough’ ‘Neither rough nor easy,’ Somewhat easy’ and ‘Extremely easy’ radio buttons disappear. Do you know how to make that work?
@happychuck77 Hiding the middle cell is gonna messed up the table structure, so i’m just gonna blur the unavailable choices and make it unclickable.
Qualtrics.SurveyEngine.addOnload(function() { jQuery("tr.Choice").each(function() { var row = jQuery(this);
var currentStateRadios = row.find("inputpname*='1']:radio"); var notStartedRadio = row.find("inputpname*='1']:radiodvalue='1']");
var easeOfTransitionOptions = row.find("inputpname*='2']:radio").not("tvalue='6']"); var cannotRateRadio = row.find("inputpname*='2']:radiodvalue='6']");