can we put count on dynamic selection in the same question of graphic options selection question?
Solved
count
Best answer by omkarkewat
Qualtrics.SurveyEngine.addOnload(function() {
var q = jQuery("#" + this.questionId);
var limit = 10;
// Add counter display
q.find(".QuestionText").after("<div class='selectionCount' style='margin-top:10px; font-weight:bold; color:#007ac0;'>Selected: 0/" + limit + "</div>");
var display = q.find(".selectionCount");
// All checkboxes in this question
var checkboxes = q.find("input[type='checkbox']");
// Count function
function updateSelectionCount() {
var count = checkboxes.filter(":checked").length;
display.text("Selected: " + count + "/" + limit);
}
// Attach listener
checkboxes.on("change", function () {
updateSelectionCount();
});
// Run once in case there's pre-selected options
updateSelectionCount();
});This is how it will look like. You can change the styling of the text according to your need.

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
