Welcome to the LimeSurvey Community Forum

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

Format of the slider question if possible

  • davebostockgmail
  • davebostockgmail's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 year 1 month ago - 1 year 1 month ago #241727 by davebostockgmail
Format of the slider question if possible was created by davebostockgmail
Please help us help you and fill where relevant:
Your LimeSurvey version:  5.6.11+230320
Own server or LimeSurvey hosting: Own server
Survey theme/template: Customised Fruity
==================
Just wondering if there was an easy way to format the question container for the slider question. We have a client who would like to see it displayed as in the attached image. 

The scale for some reason would run from 1 to 5.5 in increments of 0.1

Thanks in advance for any help 

Dave
 

Edit - The slider doesn't have to look like this I am just interested in how it can be inserted into a table .. the standard slider layout is fine
Last edit: 1 year 1 month ago by davebostockgmail.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #241749 by tpartner
Replied by tpartner on topic Format of the slider question if possible
1) Create a multiple-numeric question with one sub-question and slider enabled.

2) Insert the table HTML in the question sourcelike this:

Code:
<table>
  <tr>
    <td>Definitely Would</td>
    <td>Probably Would</td>
    <td>Might / Might Not</td>
    <td>Probably Not</td>
    <td>Definitely Not</td>
  </tr>
    <td class="slider-cell" colspan="5"></td>
  </tr>
</table>

3) Insert this script in the question source. It will move the slider into the table:

Code:
<script type="text/javascript" data-author="Tony Partner">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Move the slider
    $('.question-text tr:eq(1) td:eq(0)', thisQuestion).append($('.slider-container', thisQuestion));
  });
</script>

4) Insert some clean-up styles in the question source like this:

Code:
<style type="text/css" data-author="Tony Partner">
 
  #question{QID} .answer-container,
  #question{QID} .tooltip {
    display: none !important;
  }
 
  #question{QID} .question-text table {
    margin: 20px auto;
    width: 95%;
    max-width: 800px; 
    border-collapse: collapse; 
  }
 
  #question{QID} .question-text td {
    padding: 5px 10px;
    text-align: center;
    background-color: #FFFFFF;
    border: 1px solid #E7E7E7; 
  }
 
  #question{QID} .question-text td.slider-cell {
    padding: 15px 10px;
  }
</style>



Sample survey attached:  

File Attachment:

File Name: limesurvey...4461.lss
File Size:41 KB

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: davebostockgmail

Please Log in to join the conversation.

  • davebostockgmail
  • davebostockgmail's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 year 1 month ago #241752 by davebostockgmail
Replied by davebostockgmail on topic Format of the slider question if possible
Perfect as always .. thanks Tony

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #241759 by DenisChenu
Replied by DenisChenu on topic Format of the slider question if possible

Edit - The slider doesn't have to look like this I am just interested in how it can be inserted into a table .. the standard slider layout is fine
 
And this one is included (but we don't have triangle) : f062 in manual.limesurvey.org/Question_type_-_Mu...dle_unicode_shape.29

See fontawesome.com/v4/icons/

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.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose