Hi @spurl
you can use this code:
Qualtrics.SurveyEngine.addOnload(function() {
// Function to handle click event on "Accept All" button
var acceptAllButton = document.getElementById("QR~QID_of_question_3~1");
acceptAllButton.onclick = function() {
// Select "Accept" option for questions 1 and 2
document.getElementById("QR~QID_of_question_1~1").click();
document.getElementById("QR~QID_of_question_2~1").click();
};
// Function to handle click event on "Reject All" button
var rejectAllButton = document.getElementById("QR~QID_of_question_3~2");
rejectAllButton.onclick = function() {
// Select "Reject" option for questions 1 and 2
document.getElementById("QR~QID_of_question_1~2").click();
document.getElementById("QR~QID_of_question_2~2").click();
};
});
Replace "QR~QID_of_question_3~1"
and "QR~QID_of_question_3~2"
with the actual question IDs for the "Accept All" and "Reject All" buttons respectively. Similarly, replace "QR~QID_of_question_1~1"
and "QR~QID_of_question_1~2"
with the actual question IDs for the "Accept" and "Reject" options of question 1, and do the same for question 2.
This code will automatically select the appropriate options for questions 1 and 2 when the "Accept All" or "Reject All" button is clicked, and the changes will be reflected visually in the survey interface.