Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Change List with comment lable

More
5 years 7 months ago - 5 years 7 months ago #193371 by blocka
I'd like to change the text "Please enter your comment here:" with some alternative text. I used to be able to use the following JS, but it doesn't seem to work with 3.22.1+200129 :
Code:
 
<script type="text/javascript" charset="utf-8"> 
$(document).ready(function() {
document.body.innerHTML = document.body.innerHTML.replace('Please enter your comment here:', 'What is the main reason for the score you gave?');
}); 
 
</script>

Anyone have a suggestion to resolve?
Last edit: 5 years 7 months ago by blocka.
The topic has been locked.
More
5 years 7 months ago #193374 by blocka
Interestingly, this worked:

[code
<script type="text/javascript" charset="utf-8">

]$(document).ready(function() {
document.body.innerHTML = document.body.innerHTML.replace(/Please enter your comment here:/g, 'NEWTEXT');
});
</script>

[/code]

Not clear why only the regex version works.
The topic has been locked.
More
5 years 7 months ago #193377 by tpartner
The regex is set to replace all instances, I'm not sure that your first script does that.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
5 years 6 months ago #194009 by blocka
Upon further research, my suggestion above breaks other javascripts on the page.

Instead, use this solution:

www.limesurvey.org/forum/can-i-do-this-w...bel-how-to-change-it
The topic has been locked.
More
5 years 6 months ago #194013 by Joffm
Hi, Blocka,
that was the solution I knew that I had it somewhere but didn't find it.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose