Replace text of default error message with custom error message with the help of Jquery or JavaScrip | XM Community
Question

Replace text of default error message with custom error message with the help of Jquery or JavaScrip

  • 17 March 2020
  • 6 replies
  • 339 views

Badge
I have a Multi matrix question with around 10 columns which are displaying on the basis of responses selected by user in previous multiple response question.
User need to provide at least one answer per column and maximum of three responses per column. I have set minimum range as 1 and maximum range 3. Now I want to replace Qualtric's default error message with custom error message with the help of Jquery or JavaScript. I can't use 'Custom Survey Validation Message' property because it will change error message on other questions as well. So please suggest if anyone changed error message using JQuery or JavaScript

6 replies

Userlevel 7
Badge +22
Paste the below in JS onReady function

`jQuery(".ValidationError").html("Custom Message");`
Badge

Hi rondev
This code applies the change to all the questions which contains validation in the survey. Can I change the error message of the specific question without changing the error message of the other questions in the survey? Any help will be appreciated.

Userlevel 7
Badge +22

Paste the below code, in the JS on the specific question:
jQuery("#"+this.questionId+" .ValidationError").html("Custom Message");

Badge

Thank you so much! :)

Hi There, I'm new to Qualtrics and new to JS as well,
I see the code above and believe it should work for my multi-question error message, I place it in the JavaScript but not seeing the result, please help.
image.pngThanks,
Tea

Hi,
Thanks rondev for the code! It works well for me but there is a small lapse of time during which the default message can be seen before the custom message is displayed.
Is there a way to hide/not display the default message?
Thanks,
Marine

Leave a Reply