Hide specific comment box in multiple choice with comment

Mehr
1 Monat 2 Wochen her #188253 von Spix
Hi Tony and all others.
I have a multiple choice question with comment, where I ask for the length of a tried treatment in months. One of the options is "no treatment tried" where the comment box, asking for the duration is redundant. I would like to get rid of that one specifically.

While were on it. Is there a way to have a "months" suffix behind the comment boxes?

Cheers,
Max
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
1 Monat 2 Wochen her #188255 von tpartner
Please always attach a survey export (.lss file) containing the relevant question(s) so we don't have to spend time creating surveys.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 2 Wochen her #188256 von Spix
You're right. Here you go
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 2 Wochen her #188260 von tpartner
Add something like this to the question source:

<script type="text/javascript" charset="utf-8">
 
	$(document).on('ready pjax:scriptcomplete',function(){
 
		// Remove the first comment box
		$('#question{QID} ul.ls-answers li:eq(0) .comment-item').remove();
 
		// Insert comment suffix
		var suffixText = 'months';
		$('#question{QID} .comment-item').append('<span class="comment-suffix">'+suffixText+'</span>');
	});
</script>
 
<style type="text/css">
 
	#question{QID} input[type="text"] {
		width: auto;
		display: inline-block;
	}
</style>

You will also need to change the "Text input box width" to something like 50% to get it to look decent.



Sample survey attached:

Dateianhang:

Dateiname: limesurvey...2183.lss
Dateigröße:21 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Anhänge:
Folgende Benutzer bedankten sich: Spix

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 2 Wochen her #188291 von Spix
Thanks a lot. Works perfectly.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Tag her #188908 von surveySn
Hi Tpartner

How to add different suffixes?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Tag her #188915 von tpartner
Try this:

<script type="text/javascript" charset="utf-8">
 
	$(document).on('ready pjax:scriptcomplete',function(){
 
		// Remove the first comment box
		$('#question{QID} ul.ls-answers li:eq(0) .comment-item').remove();
 
		// Insert comment suffixes
		$('#question{QID} .comment-item:eq(0)').append('<span class="comment-suffix">Suffix 1</span>');
		$('#question{QID} .comment-item:eq(1)').append('<span class="comment-suffix">Suffix 2</span>');
		$('#question{QID} .comment-item:eq(2)').append('<span class="comment-suffix">Suffix 3</span>');
	});
</script>
 
<style type="text/css">
 
	#question{QID} input[type="text"] {
		width: auto;
		display: inline-block;
	}
</style>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 11 Minuten her #189009 von surveySn
Perfect, thank you,Tpartner

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha