how to make two question type in one wrap using limesurvey

More
5 years 2 weeks ago - 5 years 2 weeks ago #89296 by mimi
mimi created the topic: how to make two question type in one wrap using limesurvey
hi..

i want to put two question type in one question.
but when i did, it'll be separated.
i want to make it in one wrapped and the second answer is on the right side
here i attach the example of question that i've done
Attachments:
Last Edit: 5 years 2 weeks ago by mimi.

Please Log in to join the conversation.

More
5 years 2 weeks ago #89300 by jelo
jelo replied the topic: Aw: how to make two question type in one wrap using limesurvey
There is no free format question type to mix questions together out of the box.

Perhaps our javascript wizards can provide you a workaround with javascript/css to display these two question side by side.

Please Log in to join the conversation.

More
5 years 2 weeks ago #89315 by DenisChenu
DenisChenu replied the topic: Aw: how to make two question type in one wrap using limesurvey
Hello,
It's only a css problem, tou can do that in template.css too.

A javascript quick workaround.
Seem you using default template
After reading the javascript workaround section of the wiki.
In the first question
$(function() {
 $("question{QID} .question-wrapper").parent('tr').css('margin-bottom','0');
});

In the second question:
$(function() {
$("#question{QID} .questiontext").parent('tr').hide();
});

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

Please Log in to join the conversation.

More
5 years 2 weeks ago #89328 by tpartner
tpartner replied the topic: Aw: how to make two question type in one wrap using limesurvey
Or to expand on Denis's train of thought :P

Add this to the first question. It will hide the second question and move its radios to the answer element of the first.
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		// Identify the questions
		var thisQuestion = $('#question{QID}');
		var nextQuestion = $(thisQuestion).next('div[id^="question"]');
 
		// Hide the next question
		$(nextQuestion).hide();
 
		// Move the radios from the next question
		$('.answer .answer-item', thisQuestion).append($('ul.answers-list', nextQuestion));
 
		// Some cleanup styles
		$('.answer-item select, .answer-item ul, .answer-item li', thisQuestion).css({
			'float': 'left'
		});
		$('.answer-item ul', thisQuestion).css({
			'list-style': 'none',
			'margin-left': '50px'
		});
		$('.answer-item li', thisQuestion).css({
			'margin-right': '15px'
		});
	});
</script>


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in to join the conversation.

More
5 years 2 weeks ago #89376 by mimi
mimi replied the topic: Aw: how to make two question type in one wrap using limesurvey
tQ s0 much to all of u for helping.

:lol:
it works! :)

Please Log in to join the conversation.

More
4 years 10 months ago #92491 by Serafim
Serafim replied the topic: Aw: how to make two question type in one wrap using limesurvey
Hi there, is it possible repeat the code? So I would have more than one drop list and more than one second question?

Please Log in to join the conversation.

More
4 years 10 months ago #92537 by tpartner
tpartner replied the topic: Aw: how to make two question type in one wrap using limesurvey
You can repeat this code as many times on a page as you like. It will manipulate any drop-down question it is inserted in (and the following radio question).

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!