Hello,
Seems like your current script is working fine.
If you allow Text Entry for all the answers except last one, then script will hide checkboxes for all answers except last one.
@frose_fullerton
Try below code:
Qualtrics.SurveyEngine.addOnReady(function () {
function hideLabel(element) {
if (element.select('input'))0] != null || element.select('textarea'))0] != null) {
element.select('label').each(function (a, b) {
a.hide();
});
} else {
console.log(element);
}
}
var hideLabelsFlag = false;
function hideLabels() {
// QH.hideLabels() - Hides the label for any answer option where a text input has been added.
var elements = $$('.LabelWrapper');
elements.each(function (name, index) {
if (index !== elements.length - 1) {
hideLabel(name);
}
});
hideLabelsFlag = true;
}
hideLabels();
});
Added an if logic in your code.
Hope it helps!
Hi there,
It is the checkboxes I want to hide, not the labels. Is there a change to your JS that can make that happen instead?
Thanks in advance,
Frederick
@frose_fullerton
In your original post I believe you have hidden labels, hence I modified that.Also, if you hide the checkboxes and person clicks on label the data will have that choice selected. So data wouldn’t be accurate.
I still want it to show the choice was selected; I just do not want the checkbox to appear so it is more visually appealing. Is there a way to hide the checkbox but leave the labels? If so, how?
@frose_fullerton
In look and feel change the layout to Classic