Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: multiple choice with comments

multiple choice with comments 3 years 8 months ago #88393

  • hwm86
  • hwm86's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
hi,
how i can add a question multiple choice but not all with comments??
this link: grab.by/hwXs describe my question..
The administrator has disabled public write access.

multiple choice with comments 3 years 8 months ago #88402

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6126
  • Thank you received: 1359
  • Karma: 534
If you are using LimeSurvey 2.0 and just want to hide the last text input, you can set up your survey to use JavaScript and add the following to the source of the question text:
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		$('#question'+{self.qid}+' input.text:last').hide();
 
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

multiple choice with comments 3 years 8 months ago #88415

  • hwm86
  • hwm86's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
thanks it's working.
how i can choose a one of the list but isn't the last???
The administrator has disabled public write access.

multiple choice with comments 3 years 8 months ago #88440

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6126
  • Thank you received: 1359
  • Karma: 534
You can use the position index of the input to hide (note that the indexes start a 0).

So, if you wanted to hide the first input:
$('#question'+{self.qid}+' input.text:eq(0)').hide();

If you wanted to hide the third input:
$('#question'+{self.qid}+' input.text:eq(2)').hide();
More info - api.jquery.com/eq/
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 3 years 8 months ago by tpartner.
The administrator has disabled public write access.

multiple choice with comments 3 years 8 months ago #88461

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9269
  • Thank you received: 1321
  • Karma: 383
Tony, think it's better to use {QID} than {self.qid} because seem {QID} do the job more easy (for example for array question type) and with less calculation :).

Denis
(and use {SGQ} to)
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

multiple choice with comments 3 years 8 months ago #88479

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6126
  • Thank you received: 1359
  • Karma: 534
Tony, think it's better to use {QID} than {self.qid} because seem {QID} do the job more easy (for example for array question type) and with less calculation
I stand corrected.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

multiple choice with comments 3 years 8 months ago #88483

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9269
  • Thank you received: 1321
  • Karma: 383
tpartner wrote:
Tony, think it's better to use {QID} than {self.qid} because seem {QID} do the job more easy (for example for array question type) and with less calculation
I stand corrected.
{QID} and {SGQ} are here in 1.91, but found it mast month .....

:(
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.292 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form