Script or CSS to change the text on the 'password protection' page of survey | Experience Community
Skip to main content
Solved

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

  • Oct 5, 2018 10:43 PM UTC
  • 5 replies
  • 227 views

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

Best answer by TomG

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>

 

View original

5 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Oct 6, 2018 9:31 PM UTC
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> ```

Mkunza
Forum|alt.badge.img+2
  • Author
  • Oct 9, 2018 4:45 PM UTC
Worked perfectly! Thank you!!!

Forum|alt.badge.img+3
  • Level 2 ●●
  • Sep 15, 2023 4:31 AM UTC

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.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • Sep 15, 2023 3:39 PM UTC

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>

 


Forum|alt.badge.img+3
  • Level 2 ●●
  • Sep 16, 2023 2:40 AM UTC

Thanks so much!