Welcome to the LimeSurvey Community Forum

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

Type de bouton

  • daisybibi
  • daisybibi's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months ago #191311 by daisybibi
Type de bouton was created by daisybibi
Bonjour,
J'ai deux petites questions
1 - J'aimerai pouvoir présenter une question à choix unique non pas avec des boutons radio mais avec des boutons de groupe (je ne suis pas certaine du terme) comme dans la question prédéfinie du genre. Est-ce possible ?
2 - Est-il possible de modifier les propositions de la question Genre ? Si oui, comment procéder ?
Merci
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago - 4 years 4 months ago #191317 by tpartner
Replied by tpartner on topic Type de bouton
Please use English in this section of the forum.

1) If you want to use a Bootstrap Button group in a list radio, you can place the following script in the question source. Note, you should only use this for short answers as longer ones may not fit on small devices like phones.

Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    var thisQuestion = $('#question{QID}');
 
    $('.answers-list', thisQuestion).removeClass('radio-list').css('padding', '15px'); 
 
    $('.answers-list ul:eq(0)', thisQuestion).removeClass('row col-sm-12 col-xs-12').addClass('list-unstyled btn-group').attr('data-bs-toggle', 'buttons'); 
 
    $('li.answer-item', thisQuestion).removeClass('answer-item radio-item').addClass('button-item btn btn-primary');  
 
    $('input:radio:checked', thisQuestion).closest('li').addClass('active'); 
    });
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...1-19.lss
File Size:18 KB



2) Create your own list-radio question and use the workaround above.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 4 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • daisybibi
  • daisybibi's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months ago #191318 by daisybibi
Replied by daisybibi on topic Type de bouton
Thank you for you answer. I will try the solution you suggest.
Cheers
The topic has been locked.
More
3 years 9 months ago #201622 by MooMarc
Replied by MooMarc on topic Type de bouton
Hello,
I tried inserting the script above in my radio-list question source, but nothing happens when I preview. I'm using version 2.63. Am I missing something or is there something else I can do for my version?
Thanks!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #201676 by DenisChenu
Replied by DenisChenu on topic Type de bouton

MooMarc wrote: Hello,
I'm using version 2.63.

Start to put your LimeSurvey version and buil number.

You know you use a more than 3 years version with public security issues ?

You can update to 3.22 LTS version and try to hack with jquery/javascript

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.
More
3 years 9 months ago #201691 by MooMarc
Replied by MooMarc on topic Type de bouton
This is the version in use at my university and managed by IT. Maybe I can send them a message about the security issues, but I doubt they'll have a new version soon enough...
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #201706 by tpartner
Replied by tpartner on topic Type de bouton
This will not work in 2.6.x - there is a completely different HTML structure.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose