Script or CSS to change the text on the 'password protection' page of survey | XM Community
Solved

Script or CSS to change the text on the 'password protection' page of survey

  • 6 October 2018
  • 5 replies
  • 88 views

Userlevel 1
Badge +2
When I add password protection to a survey, the default message reads "This survey requires a password"
What script or css can I add to the header or 'custom css' section of the 'look & feel' editor to change this?
icon

Best answer by TomG 15 September 2023, 17:39

View original

5 replies

Userlevel 7
Badge +27
Add this JavaScript to the survey's Look & Feel Header (in source <> mode):
```
<script>
Qualtrics.SurveyEngine.addOnload(function() {
var pwLabel = jQuery("label.QuestionText[for=QR\\\\~Password]");
if(pwLabel.length == 1) pwLabel.html("My new password prompt text");
});
</script>
```
Userlevel 1
Badge +2
Worked perfectly! Thank you!!!
Userlevel 1
Badge +3

Hi @TomG, I tried this but it didn’t work.

I’m wondering if something has changed since this was written four years ago when you first responded to this?

Thanks,
Kate.

Userlevel 7
Badge +27

Hi @TomG, I tried this but it didn’t work.

I’m wondering if something has changed since this was written four years ago when you first responded to this?

Thanks,
Kate.

Yes, the Community platform updates messed up the code:

<script>
Qualtrics.SurveyEngine.addOnload(function() {
var pwLabel = jQuery("label.QuestionText[for=QR\\~Password]");
if(pwLabel.length == 1) pwLabel.html("My new password prompt text");
});
</script>

 

Userlevel 1
Badge +3

Thanks so much!

Leave a Reply