Array (numbers) - Can I switch the subquestion text and input box around?

More
2 months 2 weeks ago - 2 months 2 weeks ago #174541 by DB1324
DB1324 created the topic: Array (numbers) - Can I switch the subquestion text and input box around?
Hi all,

I need to mimic the layout of a paper questionnaire as closely as possible. This includes a simple numbers array, which by default displays like this in LimeSurvey:


However, I need to try and display the input box first on the left, and the text to the right, as per the second image:


I don't want to amend the template because that would affect other questions, so it is possible to achieve this switch round any other way?

Thanks!

(We're on Version 2.65.1+170522)
Attachments:
Last Edit: 2 months 2 weeks ago by DB1324.

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

More
2 months 2 weeks ago #174552 by tpartner
tpartner replied the topic: Array (numbers) - Can I switch the subquestion text and input box around?
Can you attach a small sample survey (.lss file) containing only that question?

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

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

More
2 months 2 weeks ago #174554 by DB1324
DB1324 replied the topic: Array (numbers) - Can I switch the subquestion text and input box around?
Hi Tony,

Yes, I've attached a sample.

Thanks
Attachments:

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

More
2 months 2 weeks ago #174560 by tpartner
tpartner replied the topic: Array (numbers) - Can I switch the subquestion text and input box around?
Add this script to the source of the question:

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
 
		// Move the array cells
		$('#question{QID} col.answertext').before($('#question{QID} col.col-hidden:eq(0)'));
		$('#question{QID} tr.subquestion-list').each(function(i) {
			$('.answertext', this).before($('.answer-item:eq(0)', this));
		});
	});
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...2221.lss
File Size:17 KB

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: DB1324

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

More
2 months 2 weeks ago #174562 by DB1324
DB1324 replied the topic: Array (numbers) - Can I switch the subquestion text and input box around?
That's perfect, thank you so much Tony. I really appreciate your help.

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!