Hi all,
I am looking for a solution that allows a question to pass a numerical validation condition if there is also a space in the question. For example, the following question:
How many employees does your organisation have?
If I write an answer such as 40, but with a space in front or after the number, the validation won't pass. Is there some way around this issue?
Regards,
Michael
Page 1 / 1
You can add this JS to take care of that:
Qualtrics.SurveyEngine.addOnReady(function () {
let qc = this.questionContainer;
document.querySelector("#NextButton").onclick = function () {
qc.querySelectorAll(".InputText").forEach((input) => {
input.value = input.value.trim();
});
};
});
The validation will still fail if there are spaces between numbers.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.