Hi, I have a Text Entry question for which I am asking a price. I have two issues:
- I would like to have the currency (.kr) next to text box. I know that I have to use a Javascript as I used it already in a previous study, but it does not work anymore. I tried several scripts, but nothing seems to work. This is the last script I tried, suggested my ChatGPT.
Qualtrics.SurveyEngine.addOnReady(function () {
const qid = this.questionId;function addPrefix() {
const q = document.querySelector("#question-" + qid);
if (!q) return;const input = q.querySelector('input[type="text"], .text-input');
if (!input || q.querySelector(".kr-prefix")) return;const prefix = document.createElement("span");
prefix.className = "kr-prefix";
prefix.textContent = "kr. ";
prefix.style.marginRight = "6px";const wrapper = document.createElement("span");
wrapper.style.display = "inline-flex";
wrapper.style.alignItems = "center";input.parentNode.insertBefore(wrapper, input);
wrapper.appendChild(prefix);
wrapper.appendChild(input);
}addPrefix();
setTimeout(addPrefix, 300);
setTimeout(addPrefix, 1000);
}); -
How can I set the validation to be only numbers? You could do it from the Add validation button, but that option now includes only lenghth options and similar, the “numeric only” option is gone and I am not sure how to set that now.
I hope someone can help!
Thanks
Giulia
