Change List with comment lable

More
3 weeks 4 days ago - 3 weeks 4 days 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 :
 
<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: 3 weeks 4 days ago by blocka.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
3 weeks 4 days 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.

Please Log in or Create an account to join the conversation.

More
3 weeks 4 days 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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
1 week 4 days 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

Please Log in or Create an account to join the conversation.

More
1 week 4 days 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

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!