- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Category separator on array (numbers) with custom JS Dropdown list
- mforster
- Topic Author
- Offline
- New Member
Less
More
6 years 10 months ago #154712
by mforster
Category separator on array (numbers) with custom JS Dropdown list was created by mforster
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10612
- Thank you received: 3691
6 years 10 months ago #154719
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Category separator on array (numbers) with custom JS Dropdown list
You can add something like this to the question text:
And then add something like this to the end of template.css:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Add a class to the question $('#question{QID}').addClass('with-separator-options'); // Loop through all dropdowns in this question $('#question{QID} .answer-item select').each(function(i) { // Insert a separator before the option with value 1 $('option[value="1"]', this).before('<option value="" disabled>Separator 1</option>'); // Insert a separator before the option with value 5 $('option[value="5"]', this).before('<option value="" disabled>Separator 2</option>'); }); }); </script>
And then add something like this to the end of template.css:
Code:
.with-separator-options .answer-item option { padding: 0 15px; } .with-separator-options .answer-item option:disabled { padding: 0; font-weight: bold; opacity: 1; color: #000000; }
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: mforster
The topic has been locked.
- LouisGac
- Visitor
6 years 10 months ago #154738
by LouisGac
Replied by LouisGac on topic Category separator on array (numbers) with custom JS Dropdown list
also, since 2.5:
getbootstrap.com/components/#dropdowns-divider
getbootstrap.com/components/#dropdowns-divider
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10612
- Thank you received: 3691
6 years 10 months ago #154748
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Category separator on array (numbers) with custom JS Dropdown list
My understanding is that these are select elements, not Bootstrap dropdown menus.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- LouisGac
- Visitor
6 years 10 months ago #154749
by LouisGac
Replied by LouisGac on topic Category separator on array (numbers) with custom JS Dropdown list
absolutely, I'm just pushing bootstrap solutions
The topic has been locked.
- mforster
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
6 years 10 months ago #154844
by mforster
Replied by mforster on topic Category separator on array (numbers) with custom JS Dropdown list
Thank you very much for your help !
The topic has been locked.