Hi Community,
I'm trying to work with can add a reset/clear option to the survey 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
ricsdpl
This would be quite difficult as for each question type a different JS would be needed it would make it more complicated.
My suggestion would be to don't go ahead with it as if at all you create that button and in future you change the question type you will have to change the button as well.
Hope it helps!
Hi Deepak, can you give me a sample reset/clear button for Side-by-side question
This should work for most questions:
Qualtrics.SurveyEngine.addOnReady(function () {
const quest = this;
const qc = quest.questionContainer;
qc.querySelector(".QuestionText").insertAdjacentHTML("afterend", "");
qc.querySelector(".reset").onclick = function () {
qc.querySelectorAll(".q-checked").forEach((item) => {
item.classList.remove("q-checked");
});
qc.querySelectorAll("select").forEach((item) => {
item.clear();
});
qc.querySelectorAll(".InputText").forEach((item) => {
item.value = "";
});
};
});
Thank you ahmedA!
Hi, how do I add this to a question?
I want a button at the end of the question that resets/clears the answers..
Thank you
@ahmedA how do I add that code so that it shows a button in the question? Thank you!!!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.