Can I do a two scale array with numeric input ?

More
1 year 1 month ago #159091 by MaloF
MaloF created the topic: Can I do a two scale array with numeric input ?
I would like to create a question that has only numeric input cell as answers, and to be able to group column with a "subtitle".

I believe this can be seen as a two scale array with numeric values ?

Please see the attachment to fully get my point. In this case, I have two "subtitles" ( France/USA) , each having two column ( NB , ETP )

Is this possible ?

Thanks
Attachments:

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

More
1 year 1 month ago #159093 by Joffm
Joffm replied the topic: Can I do a two scale array with numeric input ?
Hello, MaloF,

as far as I see, there is only a normal array(numbers), but with the additional headers.

I am sure somebody will be able to show how you can insert them.

Best regards
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

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

More
1 year 1 month ago #159096 by MaloF
MaloF replied the topic: Can I do a two scale array with numeric input ?
Thanks Joffm, yes this is it, just a normal(Array) with additional headers .
I have no idea how to do it.

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

More
1 year 1 month ago - 1 year 1 month ago #159113 by tpartner
tpartner replied the topic: Can I do a two scale array with numeric input ?
Well, you could insert those extra headers with JavaScript but it would not work on mobile devices. Probably better to combine the countries with the existing headers or use 2 separate questions.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 1 year 1 month ago by tpartner.

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

More
1 year 1 month ago #159168 by MaloF
MaloF replied the topic: Can I do a two scale array with numeric input ?
Thanks Tony,

Could you show me how to do it via Javascript (or to point me to a similar answer with javascript code) ? Because I do not need mobile device compatibility and I can't combine the countries with the header as I need to do more complex table as the attached table .

Many thanks
Attachments:

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

More
1 year 1 month ago #159170 by Joffm
Joffm replied the topic: Can I do a two scale array with numeric input ?
Well, instead of wasting too much time with these headers, why not just do it like this?
IMO you're always in a hurry when developing surveys.



That's easy, quickly implemented.

The same with your second table. Use different colors for cadres, ETAM, etc.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: MaloF

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

More
1 year 1 month ago #159180 by MaloF
MaloF replied the topic: Can I do a two scale array with numeric input ?
Thanks Joffm,

Your answer is OK to me . However I would like to proceed to a small adjustment in order to improve readability: I would like to insert a vertical line between each group ( so in your example between column 2 and 3).

I found this post : www.limesurvey.org/forum/can-i-do-this-w...or-an-array-question , but the proposed javascript code doesn't work for Array(Number).

Could you help me with this ?
Thanks

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

More
1 year 1 month ago #159209 by tpartner
tpartner replied the topic: Can I do a two scale array with numeric input ?
Something like this will insert a vertical bar between columns 2 and 3.

<script type="text/javascript" charset="utf-8">	
 
	$(document).ready(function() {
 
		var newColPosition = 3;
 
		// Identify this question
		var thisQuestion = $('#question{QID}');
 
		// Insert a new column
		$('table.subquestion-list col:eq('+(newColPosition-1)+')', thisQuestion).after('<col class="inserted-column" />');
		$('table.subquestion-list thead th:eq('+(newColPosition-1)+')', thisQuestion).after('<th class="inserted-column" />');
		$('tr.subquestion-list', thisQuestion).each(function(i) {
			$('.question-item:eq('+(newColPosition-2)+')', this).after('<td class="inserted-column" />');
		});
 
		// Some styling
		$('.inserted-column', thisQuestion).css({
			'width': '1%',
			'background': '#233140',
			'padding': '0'
		});
	});
 
</script>


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: MaloF

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

More
1 year 1 month ago #159213 by MaloF
MaloF replied the topic: Can I do a two scale array with numeric input ?
Thank you Tony, that's perfect !

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!