Hi Community,
I'm trying to work with can add a reset/clear option in the multiple question in single page that would like to clear their selections for the current question, they can simply press a reset/clear button and it would delete all the responses for that question at once
I tried this code; however, it's only working single question in single page and has an error when I click this clear/reset button it disables the validation and when I back it appears the last selection that I already reset/clear.
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
const quest = this;
const qc = quest.questionContainer;
var questionId = this.questionId;
var inputs = $(this.getQuestionContainer()).select('input[type="radio"]', 'input[type="checkbox"]', 'input[type="text"]');
qc.querySelector(".QuestionText").insertAdjacentHTML("afterend", "");
qc.querySelector(".reset").onclick = function () {
for (var i = 1; i < inputs.length; i++) {
Qualtrics.SurveyEngine.registry[questionId].setChoiceValue(i, false);
qc.querySelectorAll(".InputText").forEach((item) => {
item.value = "";
});
}
for (var i = 1; i < inputs.length; i++) {
Qualtrics.SurveyEngine.registry[questionId].setChoiceValue(i, false);
qc.querySelectorAll(".q-checked").forEach((item) => {
item.classList.remove("q-checked");
qc.querySelectorAll("select").forEach((item) => {
item.clear();
});
});
}
}
});
How to reset multiple Question
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
