List with Comment Text

More
4 years 5 months ago #119478 by Rony
Replied by Rony on topic List with Comment Text
ok. No, I'm asking for this type of question even

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

More
4 years 5 months ago - 4 years 5 months ago #119479 by AGK925
Replied by AGK925 on topic List with Comment Text
OK, for the question you want to change the comment box label, in the box where you type the question text there is a button called source. When that is selected you can see the source code for the question. Here you will type
<script type="text/javascript" charset="utf-8">	
$(document).ready(function(){
 
 $('.list-with-comment p.comment label').text('TEXT FOR COMMENT BOX:');
 
});
</script>

Below the code for the question text.
Last edit: 4 years 5 months ago by AGK925. Reason: edit code
The following user(s) said Thank You: vinz3g

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

More
4 years 5 months ago #119480 by Rony
Replied by Rony on topic List with Comment Text
Nice,AGK925
I'll try
Thank you!

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

More
4 years 5 months ago #119493 by Rony
Replied by Rony on topic List with Comment Text
It works perfectly. Thank you again!

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

More
4 years 5 months ago #119494 by AGK925
Replied by AGK925 on topic List with Comment Text
Glad it worked. I am running an older version and I have not tried to use the code on multiple questions so I wasn't positive it would work for you.
The following user(s) said Thank You: Rony

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

More
4 years 5 months ago - 4 years 5 months ago #119513 by tpartner
Replied by tpartner on topic List with Comment Text
To ensure that the script only affects the question it is loaded in and not other questions on the same page, you could use this:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
		$('#question{QID} p.comment label').text('TEXT FOR COMMENT BOX:');
	});		
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 4 years 5 months ago by tpartner.
The following user(s) said Thank You: AGK925, Rony

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

More
4 years 4 months ago #121550 by LMO
Replied by LMO on topic List with Comment Text
Thanks, I used the code and when looking at the question with "preview this question" it works fine, but at the actual survey it doesn't work anymore and the customized text is gone.

Hopefully there is a workaround, because I do not want to change te text for all the list questions with comments.

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

More
4 years 4 months ago - 4 years 4 months ago #121561 by tpartner
Replied by tpartner on topic List with Comment Text

...but at the actual survey it doesn't work anymore and the customized text is gone.

Do you have any javaScript errors in the console? Can you activate a small test survey for us to see?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 4 years 4 months ago by tpartner.

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

More
3 years 6 months ago - 3 years 6 months ago #134673 by zahorks
Replied by zahorks on topic List with Comment Text
I have the same problem and have just tried using the code posted previously (copied below) with no luck. Any suggestions as to why this is not working for me?
<script type="text/javascript" charset="utf-8">	
$(document).ready(function(){
 
 $('.list-with-comment p.comment label').text('TEXT FOR COMMENT BOX:');
 
});
</script>
Last edit: 3 years 6 months ago by zahorks.

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

More
3 years 6 months ago #134679 by tpartner
Replied by tpartner on topic List with Comment Text
It works for me in 2.06 and 2.5. Do you have any JavaScript errors?

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
3 years 6 months ago #134681 by zahorks
Replied by zahorks on topic List with Comment Text
I'm honestly not sure. I'm not a developer.

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

More
3 years 6 months ago #134691 by DenisChenu
Replied by DenisChenu on topic List with Comment Text
@zahorks : activate your javascript console to see error.
- developers.google.com/web/tools/chrome-d...g/console/console-ui
- developer.mozilla.org/en-US/docs/Mozilla...Debugging_JavaScript
- msdn.microsoft.com/en-us/library/hh696634.aspx

@tparner : maybe we have to add a "debugging javascript" somewhere in manual and ask to Carsten to link "javascript console" keywork to the page ?

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .

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

More
1 year 6 months ago - 1 year 6 months ago #167523 by krosser
Replied by krosser on topic List with Comment Text

tpartner wrote: To ensure that the script only affects the question it is loaded in and not other questions on the same page, you could use this:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
		$('#question{QID} p.comment label').text('TEXT FOR COMMENT BOX:');
	});		
</script>


Hey guys!
I've tried this in LS version 3.6.2 and it doesn't work. Does anyone know what should be tweaked in the code in order to work?
Cheers!! :)

I'm using the latest LS 3.17 hosted on LS servers, not installed locally.
Last edit: 1 year 6 months ago by krosser. Reason: figured that QID shouldn't be changed

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

More
1 year 6 months ago #167529 by tpartner
Replied by tpartner on topic List with Comment Text
This should work in 3.x:

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
		$('#question{QID} .text-item label').text('TEXT FOR COMMENT BOX:');
	});
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: ecoplan, ConradNg, krosser

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

More
1 year 5 months ago #167663 by krosser
Replied by krosser on topic List with Comment Text

tpartner wrote: This should work in 3.x:

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
		$('#question{QID} .text-item label').text('TEXT FOR COMMENT BOX:');
	});
</script>


Yes, it does work! Many thanks, Tony!

I'm using the latest LS 3.17 hosted on LS servers, not installed locally.

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!