Hi @Lee783 ,
You can add below JS code to your question for the same :
How are you adding this?
See this JS:
document.querySelector("#NextButton").value = "first line \n second line \n third line";
Thank you so much! This worked! How can I display a text depending on the language, e.g. if q_language=DE display “xxxxx” ?
I thought of something like:
{
let lang = "${e://Field/Q_Language}",
document.querySelector("#NextButton").value;
switch (lang) {
case "EN":
document.querySelector("#NextButton").value = "first line \n second line \n third line";
default:
document.querySelector("#NextButton").value = " xxxxx";
}
}
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
});
Qualtrics.SurveyEngine.addOnReady(function()
{
const translations = {
"RU": "Я даю согласие на обработку, как \n описано выше, и буду участвовать \n в исследовании рынка",
"DE": "Ich bin mit der oben beschriebenen \n Verarbeitung einverstanden und \n werde an der Marktstudie teilnehmen",
"HI": "मैं ऊपर वर्णित अनुसार प्रसंस्करण \n के लिए सहमति देता हूं और \n बाजार अध्ययन में भाग लूंगा",
"EN": "I consent to the processing \n as described above and will participate \n in the market study"
};
const update = (lan) => {
const translation = translations lan] || translations"EN"];
document.querySelector("#NextButton").value = translation;
};
update(document.querySelector("#Q_lang").value);
document.querySelector("#Q_lang").addEventListener("change", (event) => {
update(event.target.value);
});
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Hope this resolves your query!!