Check out the LimeSurvey source code on GitHub!

Multiple numeric input with different suffixes

  • AdrianB
  • AdrianB's Avatar Topic Author
  • Visitor
  • Visitor
3 years 6 months ago #98857 by AdrianB
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.

Please Log in to join the conversation.

More
3 years 6 months ago #98879 by tpartner
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.
Attachments:
The following user(s) said Thank You: AdrianB

Please Log in to join the conversation.

  • AdrianB
  • AdrianB's Avatar Topic Author
  • Visitor
  • Visitor
3 years 6 months ago #99020 by AdrianB
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! :)

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form