- Posts: 78
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Merge array questions and add % symbol
- tixeon
- Topic Author
- Offline
- Senior Member
Less
More
4 years 10 months ago - 4 years 10 months ago #185758
by tixeon
Merge array questions and add % symbol was created by tixeon
Hi,
Is there a way I can do the following in the attached:
so that it looks like this?
[edit] Version 3.17.5
Is there a way I can do the following in the attached:
- Put a % symbol after each text box in the first question
- For the second question, make it look like it is part of the first question (remove the column headers and question text) and put it in the same question border
so that it looks like this?
[edit] Version 3.17.5
Attachments:
Last edit: 4 years 10 months ago by tixeon.
The topic has been locked.
- gabrieljenik
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 272
- Thank you received: 45
4 years 10 months ago #185759
by gabrieljenik
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .
Replied by gabrieljenik on topic Merge array questions and add % symbol
You need some custom CSS to do that. Maybe apply custom classes to those questions and then set the rules for them.
Use input:after for the % sign.
Use input:after for the % sign.
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
4 years 10 months ago - 4 years 10 months ago #185769
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 Merge array questions and add % symbol
Or use JavaScript to move the array rows from Q2 into the Q1 array and completely hide Q2.
Can you attach a small sample survey (.lss file) containing only the relevant questions?
Can you attach a small sample survey (.lss file) containing only the relevant questions?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 10 months ago by tpartner.
The topic has been locked.
- tixeon
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 2
4 years 10 months ago #185770
by tixeon
Replied by tixeon on topic Merge array questions and add % symbol
Thanks Tony, I thought I had attached the .lss. Trying again.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
4 years 10 months ago #185781
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 Merge array questions and add % symbol
You will need to add a script like this to the source of the first question:
And some CSS like this (this could be in your custom.css file):
Sample survey attached:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:complete',function() { // Identify the questions var thisQuestion = $('#question{QID}'); var nextQuestion = $(thisQuestion).next('.question-container'); // Hide the next question $(nextQuestion).hide(); // Insert the "%" symbols $(thisQuestion).addClass('with-inserted-symbols'); $('.answer-item input:text', thisQuestion).after('<span class="inserted-symbol">%</span>'); // Move the array row $('table.subquestion-list', thisQuestion).append($('tr.answers-list', nextQuestion)); }); </script>
And some CSS like this (this could be in your custom.css file):
Code:
<style type="text/css"> .with-inserted-symbols .answer-item input[type="text"] { display: inline-block; } .inserted-symbol { margin-left: 5px; } </style>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: tixeon
The topic has been locked.
- gabrieljenik
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 272
- Thank you received: 45
4 years 10 months ago #185782
by gabrieljenik
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .
Replied by gabrieljenik on topic Merge array questions and add % symbol
Nice
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .
The topic has been locked.
- tixeon
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 2
4 years 10 months ago #185791
by tixeon
Replied by tixeon on topic Merge array questions and add % symbol
That works perfectly and with such nice efficient code, many thanks!
The topic has been locked.