- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Multiple Numeric Suffixes
- rickyd
-
Topic Author
- Offline
- New Member
-
Less
More
7 years 11 months ago #127484
by rickyd
Multiple Numeric Suffixes was created by rickyd
Hello,
I'm trying to create a multiple numeric input type question. Each sub question will need it's own unique suffix but as far as I can tell, this is not possible as the only suffix option I could find adds the same suffix to every sub question. Is there a way to get around this?
Thank you,
rickyd
I'm trying to create a multiple numeric input type question. Each sub question will need it's own unique suffix but as far as I can tell, this is not possible as the only suffix option I could find adds the same suffix to every sub question. Is there a way to get around this?
Thank you,
rickyd
The topic has been locked.
- tpartner
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 10356
- Thank you received: 3585
7 years 11 months ago - 7 years 11 months ago #127518
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple Numeric Suffixes
You can try adding something like this to the question source:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question'+qID+' li.question-item:eq(0) span.input').append('per minute'); $('#question'+qID+' li.question-item:eq(1) span.input').append('per hour'); $('#question'+qID+' li.question-item:eq(2) span.input').append('per day'); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 11 months ago by tpartner.
The topic has been locked.
- rickyd
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
7 years 11 months ago #127536
by rickyd
Replied by rickyd on topic Multiple Numeric Suffixes
Thank you for responding! I'm having a little trouble adapting that code to my survey, what would I need to change in that code to get it to work with my specific question code structure?
The topic has been locked.
- tpartner
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 10356
- Thank you received: 3585
7 years 11 months ago #127543
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple Numeric Suffixes
The code should work as-is.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- rickyd
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
7 years 11 months ago #127546
by rickyd
Replied by rickyd on topic Multiple Numeric Suffixes
It doesn't seem to be working as is. It's entered in the source area of the question and I've gotten javascript to work on this server before.
The topic has been locked.
- tpartner
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 10356
- Thank you received: 3585
7 years 11 months ago #127547
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple Numeric Suffixes
My mistake, I have typos in the code. It should be:
Sample survey attached:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question'+{QID}+' li.question-item:eq(0) span.input').append('per minute'); $('#question'+{QID}+' li.question-item:eq(1) span.input').append('per hour'); $('#question'+{QID}+' li.question-item:eq(2) span.input').append('per day'); }); </script>
Sample survey attached:
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: holch, rickyd
The topic has been locked.
- holch
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 11292
- Thank you received: 2605
7 years 11 months ago #127561
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Multiple Numeric Suffixes
Hehehehe, had tried it as well and it didn't work for me either, until I changed qID with the actual ID of the question id. Tried it with the question code first, then checked the source code and saw that the number is used.
But this is of course the better solution...
Works like a charm now, even in my custom template.
But this is of course the better solution...

Works like a charm now, even in my custom template.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: rickyd
The topic has been locked.
- rickyd
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
7 years 11 months ago #127604
by rickyd
Replied by rickyd on topic Multiple Numeric Suffixes
This is great and it works like a charm!! Thank you so much.
The topic has been locked.