How do I generate a custom error message without forced response? | XM Community
Skip to main content

I am trying to generate an error message on a question if the participant uses less than 2 characters to respond. The question cannot be a forced response and I would like to customize the error response. Thoughts? Options?

Hi mrue
Use the below code and add in JavaScript onload options.. hope this helps
note: please checkout for non-English characters
/*Place your JavaScript here to run when the page loads*/
var that = this.questionId;
jQuery("[id='QR~"+that+"']").focusout(function(){
var myLength = jQuery("[id='QR~"+that+"']").val().length;
if(myLength <= 2){
alert("Please enter the text more than two characters");
}
});


https://www.qualtrics.com/community/discussion/12977/how-do-i-generate-a-custom-error-message-without-forced-responseYou can use custom validation. The condition would be the field can be empty or match a regex that matches two or more characters:

^.*{2,}$


Leave a Reply