Changing Error Message for "Request response" | XM Community
Skip to main content

I've developed a survey available in four languages. Utilizing code obtained from a discussion thread, I've successfully customized the error message for the 'request response' based on each participant's preferred language for completing the survey. However, the response options accompanying the 'request response' message ('Continue Without Answering' and 'Answer the Question') remain unchanged. Participants indicate their preferred survey language by answering a question. Any assistance in addressing this issue would be greatly appreciated.

Hi @alex4524 
You can use the below code to change the button text as well. (i.e., 'Continue Without Answering' and 'Answer the Question')
 

Qualtrics.SurveyEngine.addOnReady(function(){
  document.querySelector("#NextButton").onclick = function() {
    my_interval = setInterval(() => {
      err_msg = document.querySelector("#ErrorMessage");
      if (err_msg != null) {
        err_msg.innerText = "Custom Message";
        
        // Replace the text of the first button
        errorButton1 = document.querySelector("div.ErrorButtons button:nth-child(1)");
        if (errorButton1 != null) {
          errorButton1.innerText = "Move forward";
        }

        // Replace the text of the second button
        errorButton2 = document.querySelector("div.ErrorButtons button:nth-child(2)");
        if (errorButton2 != null) {
          errorButton2.innerText = "Move forward";
        }

        clearInterval(my_interval);
      }
    }, 10);
  };
});

 

I have set the button text as 'Move forward' for both buttons and the custom message as 'Custom Message.' Please feel free to change it according to your needs.


That worked perfectly. Thank you @omkarkewat!!! 


Leave a Reply