how to mix two dropdown list together in one box

More
4 years 7 months ago - 4 years 7 months ago #90000 by mimi
mimi created the topic: how to mix two dropdown list together in one box
<script type="text/javascript">

$(document).ready(function () {

$("#td_for_G2_Q0014").attr("width","30%"); //make column 1 width 30%
$("#td_for_G2_Q0014_input ul").attr("style", "list-style:none outside none"); //make checkbox into horizontal line
$("#td_for_G2_Q0014_input li").attr("style", "float:left; margin-left:10px"); //"

$("#td_after_G2_Q0014").html($("#td_for_G2_Q0015").html()); //copy from next question
$("#question98").remove();

// 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>



the code above is if we want to mix drpdown list and 5 point choice together in one box.
but how can we mix drpdown list with another drpdown list in one box?
which part from the code can i change.

TQ~
Last Edit: 4 years 7 months ago by mimi.

Please Log in to join the conversation.

More
4 years 7 months ago - 4 years 7 months ago #90008 by tpartner
tpartner replied the topic: how to mix two dropdown list together in one box
I'm not sure what the first 5 or 6 lines are supposed to do but the pertinent code would be:
<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 select (dropdown) from the next question
		$('.answer .answer-item', thisQuestion).append($('.answer .answer-item select', nextQuestion));
 
		// Some cleanup styles
		$('.answer-item select', thisQuestion).css({
			'float': 'left',
			'margin': '0 25px 10px 0'
		});
	});
</script>


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 4 years 7 months ago by tpartner.

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now