- Posts: 2
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
LimeSurvey is surprisingly missing functionality around the other field.markladius wrote: I am wondering how to achieve this?
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.
I tootpartner wrote: I would prefer to move the "Other" row with JS to avoid extra columns in the data.
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.
<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 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>
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">
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.
<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>
tpartner wrote: Did I hear someone call my name?