- Posts: 15
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Modify slider max/min values for each sub-question
- DWS
- Topic Author
- Offline
- New Member
Less
More
9 years 9 months ago #109881
by DWS
Modify slider max/min values for each sub-question was created by DWS
Hi, on limesurvey 1.92 I can modify the sliders max/min values for each sub-question with the following javascript:
<script type="text/javascript" charset="utf-8">
$('#slider-param-max-55874X17X140d1').attr( "value","45" );
</script>
but on 2.05 the sliders max/min value are fixed for the whole question. Can I modify it individually?
Thanks.
<script type="text/javascript" charset="utf-8">
$('#slider-param-max-55874X17X140d1').attr( "value","45" );
</script>
but on 2.05 the sliders max/min value are fixed for the whole question. Can I modify it individually?
Thanks.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
9 years 9 months ago #109925
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 Modify slider max/min values for each sub-question
You can add something like this to the source of a slider question.
.
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question'+{QID}+''); // Set the slider maximums $('.ui-slider:eq(0)', thisQuestion).slider('option', 'max', 45 ); // First slider $('.ui-slider:eq(1)', thisQuestion).slider('option', 'max', 60 ); // Second slider $('.ui-slider:eq(2)', thisQuestion).slider('option', 'max', 80 ); // Third slider // Adjust the "Slider Max" displayed $('.ui-slider', thisQuestion).each(function(i) { $('.slider-showmax', this).text($(this).slider('option', 'max')); }); }); </script>
.
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: DWS
The topic has been locked.
- DWS
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
9 years 9 months ago #109928
by DWS
Replied by DWS on topic Modify slider max/min values for each sub-question
Thanks, works perfectly.
Nice job, as always
Nice job, as always
The topic has been locked.