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

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

  • March 17, 2020
  • 6 replies
  • 531 views

Forum|alt.badge.img
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

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • March 17, 2020
Paste the below in JS onReady function `jQuery(".ValidationError").html("Custom Message");`

Forum|alt.badge.img
  • June 22, 2020

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.


rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • June 22, 2020

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


Forum|alt.badge.img
  • June 22, 2020

Thank you so much! :)


  • May 4, 2021

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


  • May 7, 2021

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