I have a matrix question, with 8 statements and 8 scale points. The 8th scale point is hiden for statements 1-7. The 8th statement has a text entry because is “Other (specify)”.
What I need is to hide the text entry when the 8th scale point is selected for the 8th statement, and show it when any of the other scale points are selected in this statement.
I attach a screenshot of my question and a basic code that I tried to format on my specifications but failed.
Can anyone help me with this?
Javascript code:
Qualtrics.SurveyEngine.addOnReady(function() {
var qid = this.questionId;
var text = document.getElementById("QR~" + qid + "~3~TEXT");
jQuery(text).css("display", "none");
// Assuming the scale points are represented by radio buttons in the third row
jQuery("#" + qid + " tbody tr:eq(2) input type=radio]").eq(0).change(function() {
if (jQuery(this).prop("checked")) {
jQuery(text).css("display", "block");
} else {
jQuery(text).css("display", "none");
}
});
});