- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Multiple Choice Question Type - Moving the Other subquestion
- markladius
- Topic Author
- Offline
- New Member
- LouisGac
- Visitor
- jelo
- Offline
- Platinum Member
- Posts: 5070
- Thank you received: 1263
LimeSurvey is surprisingly missing functionality around the other field.markladius wrote: I am wondering how to achieve this?
There is a feature request open, where you could add your ideas:
bugs.limesurvey.org/view.php?id=7367
Depending on what kind of functionality is needed (e.g. check the other field with EM),
you might can do a workaround on the "Multiple-choice with comments" question type.
manual.limesurvey.org/Question_types#Mul...choice_with_comments
Just hide comment fields at all positions not needed via CSS.
Since nearly all workarounds depend on the version/build of LimeSurvey, please state the version/build you're using right now.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
I would prefer to move the "Other" row with JS to avoid extra columns in the data.Depending on what kind of functionality is needed (e.g. check the other field with EM),
you might can do a workaround on the "Multiple-choice with comments" question type. Just hide comment fields at all positions not needed via CSS.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- jelo
- Offline
- Platinum Member
- Posts: 5070
- Thank you received: 1263
I tootpartner wrote: I would prefer to move the "Other" row with JS to avoid extra columns in the data.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
- markladius
- Topic Author
- Offline
- New Member
- Posts: 2
- Thank you received: 0
www.limesurvey-consulting.com/how-to-re-...a-limesurvey-survey/
Good luck
- jelo
- Offline
- Platinum Member
- Posts: 5070
- Thank you received: 1263
Depends on the version/build of LimeSurvey. You're not on LS 2.5 or above, right?markladius wrote: For anyone that runs into this issue. Here is a solution which worked.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
- kwalker
- Offline
- New Member
- Posts: 4
- Thank you received: 0
I asked Dr. Minke about this and he suggested I post on the forum to see if anyone can help adjust the script.
Here's a link to a test survey with the issue: hsprn.hostedincanadasurveys.ca/index.php/948713?lang=en
- Joffm
- Offline
- LimeSurvey Community Team
- Posts: 12713
- Thank you received: 3924
I am not able to solve the problem, but I know where there is the issue.
Here the code of the "Other" Item:
<div class="col-sm-12"> <div id="javatbd766924X56X15651other" class="question-item answer-item checkbox-item form-group checkbox"> <div class="pull-left othertext-label-checkox-container"> <input id="answer766924X56X15651othercbox" class="checkbox other-checkbox dontread" name="766924X56X15651othercbox" aria-labelledby="label-766924X56X15651othercbox" type="checkbox"> <label class="answertext" for="answer766924X56X15651othercbox"></label> <div id="label-766924X56X15651othercbox" class="label-text label-clickable"> </div> <div class="pull-left"> <input id="answer766924X56X15651other" class="form-control input-sm text empty" name="766924X56X15651other" value="" type="text"> </div> <input id="java766924X56X15651other" name="java766924X56X15651other" value="" type="hidden"> </div>
</div>
followed by a new
<div class="col-sm-12">
And here the code of the following "normal" checkbox
<div id="javatbd766924X56X156514" class="question-item answer-item checkbox-item form-group checkbox"> <input id="answer766924X56X156514" class="checkbox" name="766924X56X156514" value="Y" onclick="cancelBubbleThis(event); checkconditions(this.value, this.name, this.type)" aria-labelledby="label-answer766924X56X156514" type="checkbox"> <label class="answertext" for="answer766924X56X156514"></label> <div id="label-answer766924X56X156514" class="label-text label-clickable"> Item 4 </div> <input id="java766924X56X156514" name="java766924X56X156514" value="" type="hidden"> </div> </div>
I hope I marked the right place.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
- Mazi
- Offline
- Official LimeSurvey Partner
Please file a bug report if there is some invalid HTML for a certain question type.Joffm wrote: Hi,
I am not able to solve the problem, but I know where there is the issue.
IMHO here should be a
</div>
followed by a new
<div class="col-sm-12">
Thanks!
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
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
Did I hear someone call my name?I asked Dr. Minke about this and he suggested I post on the forum to see if anyone can help adjust the script.
In version 2.54.3, you can use something like this (note, it may not work in future versions if the HTML structure is changed again):
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // New position of the "Other" row (edit as required) var newPosition = 3; //// NO EDITING REQUIRED BELOW HERE //// var thisQuestion = $('#question{QID}'); var otherRow = $('.answer-item[id$="other"]', thisQuestion).parent(); var replaceRow = $('.answer-item:eq('+(newPosition-1)+')', thisQuestion).parent(); $(replaceRow).before($(otherRow)); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- Mazi
- Offline
- Official LimeSurvey Partner
tpartner wrote: Did I hear someone call my name?
Yes, I explicitly told the user to wait for our JS wizzard to answer this one
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