Skip to content

Instantly share code, notes, and snippets.

@marketinview
Last active February 17, 2025 15:07
Show Gist options
  • Save marketinview/da04721c50f6d8340dacb045069fddb1 to your computer and use it in GitHub Desktop.
Save marketinview/da04721c50f6d8340dacb045069fddb1 to your computer and use it in GitHub Desktop.
Qualtrics: Reset Likert Matrix. Works with single or multi-select matrix. Add button html to question text. #qualtrics #js #jq #matrix #likert #reset
<button class="reset">Reset</button>
Qualtrics.SurveyEngine.addOnload(function() {
var qobj = this;
var q = jQuery("#"+qobj.questionId);
var inputs = q.find(".QuestionBody").find("[type=radio],[type=checkbox]");
q.find(".reset").click(function() {
inputs.filter(":checked").each(function() {
var parts = this.id.split("~");
qobj.setChoiceValue(parts[2],parts[3],false);
});
});
});
@marketinview
Copy link
Author

See additional Qualtrics solutions at: https://qualtricswiki.tgibbons.com/doku.php

@bridgeovertroubledhuman

Hello, this works like a charm! Thanks!

However, I would like to know, if you know, is it possible to not show a reset button but automatically reset whenever a custom error message comes up?

@marketinview
Copy link
Author

Hello, this works like a charm! Thanks!

However, I would like to know, if you know, is it possible to not show a reset button but automatically reset whenever a custom error message comes up?

Yes, you could trigger it that way.

@bridgeovertroubledhuman

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment