- Posts: 6
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Adding "Other:" option to array
- pari2205
- Topic Author
- Offline
- New Member
Less
More
2 years 3 weeks ago - 2 years 3 weeks ago #226855
by pari2205
Replied by pari2205 on topic Adding "Other:" option to array
Last edit: 2 years 3 weeks ago by pari2205.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
2 years 3 weeks ago #226856
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 Adding "Other:" option to array
Did you look at your post? Don't paste images, use the editor to insert them.
Did you try importing my survey? This is why I provide them.
Did you try importing my survey? This is why I provide them.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
2 years 3 weeks ago #226857
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 Adding "Other:" option to array
Do you have permissions to insert JavaScript?
- manual.limesurvey.org/Workarounds:_Manip...tc..29_in_LimeSurvey
- manual.limesurvey.org/Workarounds:_Manip...tc..29_in_LimeSurvey
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.
- pari2205
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
2 years 3 weeks ago #226858
by pari2205
Replied by pari2205 on topic Adding "Other:" option to array
Yes, I edited the post.
Unfortunately I cannot import your survey nor anything because I am not the site admin: we are doing this survey for a University project and our professor is the admin.
Unfortunately I cannot import your survey nor anything because I am not the site admin: we are doing this survey for a University project and our professor is the admin.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12921
- Thank you received: 3977
2 years 3 weeks ago #226859
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Adding "Other:" option to array
But your screenshot looks as if you are not allowed to enter javascript code.
Ask the admin of your LimeSurvey installation.
The XSS filter seems to be activated.
If you have the rights to do this you only
add the script to the question text in source code mode.
And create a subquestion called "Others"
Joffm
Ask the admin of your LimeSurvey installation.
The XSS filter seems to be activated.
If you have the rights to do this you only
add the script to the question text in source code mode.
And create a subquestion called "Others"
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: pari2205
Please Log in to join the conversation.
- pari2205
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
2 years 3 weeks ago #226860
by pari2205
Replied by pari2205 on topic Adding "Other:" option to array
I will ask her, thank you
Please Log in to join the conversation.
- Mazi
- Offline
- Official LimeSurvey Partner
1 year 6 months ago #232525
by Mazi
It adds the fields like this:
You can also check the demo survey at plugins.mysurveyhosting.com/index.php/362484?newtest=Y&lang=en .
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Adding "Other:" option to array
An easier to use solution could be this plugin which doesn't require adding any custom JavaScript for having text fields at array questions: survey-consulting.com/product/array-with...t-limesurvey-plugin/Do you have permissions to insert JavaScript?
It adds the fields like this:
You can also check the demo survey at plugins.mysurveyhosting.com/index.php/362484?newtest=Y&lang=en .
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Please Log in to join the conversation.
- KatMey99
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
6 months 1 week ago #251127
by KatMey99
Replied by KatMey99 on topic Adding "Other:" option to array
Dear Tony Partner team,
I have come across your code to add an other option to arrays which has been very helpful. However, it doesn't seem to work to add an other option to "Array by column" questions, when the other option should be among the answer options in the rows (see picture below for illustration). I would be grateful for your guidance on how to adjust the code for this question type.
(I am using version 3.28.56.)
Thank you!
I have come across your code to add an other option to arrays which has been very helpful. However, it doesn't seem to work to add an other option to "Array by column" questions, when the other option should be among the answer options in the rows (see picture below for illustration). I would be grateful for your guidance on how to adjust the code for this question type.
(I am using version 3.28.56.)
Thank you!
Attachments:
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
6 months 1 week ago - 6 months 1 week ago #251128
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 Adding "Other:" option to array
This script will move the "Other" input into the last row of an array-by-column question:
Sample survey attached:
Code:
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify the questions var thisQuestion = $('#question{QID}'); var nextQuestion = thisQuestion.nextAll('.text-short:eq(0)'); // Hide the next question nextQuestion.hide(); // Move the text inputs $('tr[id^="javatbd"]:last td.answertext', thisQuestion).append($('.answer-item', nextQuestion)); // Clean-up styling $('td.answertext .answer-item', thisQuestion).css({ 'padding': 0 }); $('td.answertext .answer-item div', thisQuestion).css({ 'padding': 0 }); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 months 1 week ago by tpartner.
The following user(s) said Thank You: KatMey99
Please Log in to join the conversation.
- KatMey99
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
6 months 1 week ago #251138
by KatMey99
Replied by KatMey99 on topic Adding "Other:" option to array
Thank you so much for the prompt reply, this is just what I was looking for!
Please Log in to join the conversation.
- bellagambad
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 0
2 months 2 weeks ago #255673
by bellagambad
Replied by bellagambad on topic Adding "Other:" option to array
Hi tpartner,
Thanks again for your solutions. I came across this topic, which helped me a lot. Is there a way to modify your code so that we have a button to add more "other" lines ? Or add a "other" line if the previous one is completed ?
I am using LS community edition 5.4.x
Thank you in advance !
Best regards,
David
Thanks again for your solutions. I came across this topic, which helped me a lot. Is there a way to modify your code so that we have a button to add more "other" lines ? Or add a "other" line if the previous one is completed ?
I am using LS community edition 5.4.x
Thank you in advance !
Best regards,
David
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12921
- Thank you received: 3977
2 months 2 weeks ago #255674
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Adding "Other:" option to array
1.More other lines?
Add more "short text" questions
2. Button?
Something similöar.
Search the forum for "varLengthArray"
3. Show if the previous is completed?
Use subquestion relevance to display the row if the previous is "not empty"
Joffm
Add more "short text" questions
2. Button?
Something similöar.
Search the forum for "varLengthArray"
3. Show if the previous is completed?
Use subquestion relevance to display the row if the previous is "not empty"
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.