Pick, Group & Rank: Change Validation Alert Text | XM Community
Skip to main content
Hi,



Can I use custom code to alter the text of the validation alert:

For example, can I change the text "No more than a 9 choice(s)"



!



Custom Validation is not an option as there are far too many options.



Thanks 😀
Hey @usama_shoaib1! Unfortunately, you cannot currently alter the text of the alert for the validation you have setup for your Pick, Group & Rank question. If you are interested in having this functionality be considered in the future development of our product, I would recommend posting this in our Product Ideas category, as it is a feature not already developed by our team. Be sure to review the How to Write a Good Product Idea template and our Ideation Guidelines before you post your idea!
Actually, while you can't alter the validation error text that Qualtrics displays, you can change it with JavaScript after is has been displayed. Since the page reloads when there is a validation error, you can have JavaScript look for the validation error text on load, then change it to your preferred text. It will happen so fast that it will be barely noticeable (i.e., it will change before the respondent can read it).

TomG : Is there a way to add 2 different validation errors depending on which min/max criteria they are missing? E.g., if a min of 12 and max of 14 is required, I would like to provide a different validation error message depending on the number they selected . Right now, it shows the default message for each error.


https://community.qualtrics.com/XMcommunity/discussion/comment/52937#Comment_52937You would have to write JS to figure out which criteria apply and modify the error message accordingly.


TomG : Thanks. Not super familiar with custom JS, so will have to investigate further. If I wanted a custom validation error message without any criteria when the page loads, would the code below work? And, would it go in the addOnload or addRead portions?

jQuery("#"+this.questionId+" .ValidationError").html("CUSTOM VALIDATION ERROR MESSAGE");


https://community.qualtrics.com/XMcommunity/discussion/comment/52941#Comment_52941The code should work.
You can put it in addOnload (although it probably doesn't matter).


TomG : That didn't work. It still keeps showing the default error message. I will keep investigating.


Try this:
jQuery("#"+this.questionId+" .ValidationError:visible").html("CUSTOM VALIDATION ERROR MESSAGE");


Leave a Reply