Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Question about placement of answers in List with comment questions

  • midnightking
  • midnightking's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 5 months ago #207974 by midnightking
I was wondering if it is possible to have possible answers be side by side , a certain distance one from the other, rather than one on top of the other in a list with comment question.

If so, how do I use JavaScript to do it? Thanks

File Attachment:

File Name: limesurvey... (6).lss
File Size:46 KB
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208027 by tpartner
LimeSurvey version?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • midnightking
  • midnightking's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 5 months ago #208086 by midnightking
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208094 by DenisChenu

tpartner wrote: LimeSurvey version?

@tpartner ask for your LimeSurvey version

You can add where your hosted too (survey base url)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208119 by holch

Limesurvey Version?

Yes.


This is going to be funny...

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • midnightking
  • midnightking's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 5 months ago #208142 by midnightking
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago - 3 years 5 months ago #208196 by tpartner
You could apply buttons as in the "Bootstrap Buttons" question theme for a normal list radio question.

Add this script to the question source.

(this could also be accomplished with a new custom question theme)

Code:
<script type="text/javascript" charset="utf-8">  
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Modify classes
    $('.answers-list', thisQuestion).removeClass('col-sm-6 col-xs-12').addClass('row ls-answers form-inline');
    $('.answer-item input:radio', thisQuestion).addClass('bootstrap-radio sr-only');
    $('.answer-item label', thisQuestion).removeClass('radio-label control-label');
 
    // Insert the Bootstrap buttons
    $('.answer-container', thisQuestion).prepend('<div class="container-fluid" />');
    $('.answer-container > .container-fluid', thisQuestion).append($('.answers-list', thisQuestion));
    $('.answer-item.radio-item', thisQuestion).each(function(i) {
      var thisID = $(this).attr('id');
      $('.answers-list', thisQuestion).append(
        '<div id="'+thisID+'" class="bootstrap-buttons-div col-xs-12 col-sm-2 inserted-button-div">\
            <div class="button-item btn btn-primary col-xs-12 col-sm-12"></div>\
        </div>'
      );
      $('div.inserted-button-div[id="'+thisID+'"] .button-item', thisQuestion).append($('*', this));
 
    });
    });
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...1315.lss
File Size:17 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 5 months ago by tpartner.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose