Welcome, Guest
Username: Password: Remember me

TOPIC: Multiple numeric input with different suffixes

Multiple numeric input with different suffixes 1 year 3 months ago #98857

  • AdrianB
  • AdrianB's Avatar
Hi all,

I'd like to create a "multiple numeric input" question and use a different suffix for each of the subquestions. At the moment, I can only seem to set one suffix that is applied to every subquestion.

Is it possible to setup a suffix per subquestion?

Cheers,

A.
The administrator has disabled public write access.

Multiple numeric input with different suffixes 1 year 3 months ago #98879

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4359
  • Thank you received: 826
  • Karma: 381
You can do it with a little Javascript.

Set up your survey to use JavaScript and add something like the following to the question source:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function(){
		var thisQuestion = $('#question{QID}');
 
		$('input.text:eq(0)', thisQuestion).after('/day')
		$('input.text:eq(1)', thisQuestion).after('/month')
		$('input.text:eq(2)', thisQuestion).after('/year')
		$('input.text:eq(3)', thisQuestion).after('/decade')
	});
</script>

Attachment Capture_2013-08-06.JPG not found

Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: AdrianB

Multiple numeric input with different suffixes 1 year 3 months ago #99020

  • AdrianB
  • AdrianB's Avatar
Sorry for the delay in responding, I became sidetracked at work.

Your reply solved the problem really nicey and it's working great now. Many thanks! :)
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.091 seconds
Donation Image