How to add javascript | XM Community
Skip to main content

How to add javascript

  • October 20, 2022
  • 3 replies
  • 744 views

Forum|alt.badge.img

Hello:
I'm new to qualtrics and I'm trying to figure out how to change the error message "Please answer this question" for those who don't answer a question. I know this has been discussed before, and I did see some java code for doing this - see below. But I'm not sure where to put the code. I went to general then to header, but I as under the impression that there's supposed to be a button that looks like this <> that one uses to add the script. But I don't see it.
Any guidance would be greatly appreciated!

Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery (".ValidationError").html('');
jQuery (".ValidationError").append("Your custom error message");
});

3 replies

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • October 20, 2022

geno
You can do two things here

  1. You can include JS in header source by clicking on source as you see in image below

image.png2 You can create a custom message by going within Survey Options>> Responses>> Custom Error message to change it once and for all.
image.pngHope it helps!


Forum|alt.badge.img
  • Author
  • October 20, 2022

Thank you so much, Deepak!


SuhasM
Qualtrics Employee
Forum|alt.badge.img+16
  • Qualtrics Employee
  • October 21, 2022

Thank you so much Deepak for being thoughtful and sharing multiple solutions! 👏