- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Problem with mandatory sliders and hidden handles
- HellaHepp
- Topic Author
- Offline
- New Member
Less
More
8 years 10 months ago #120939
by HellaHepp
Problem with mandatory sliders and hidden handles was created by HellaHepp
Hi!
I wanted to include sliders in my survey with hidden handle by default until user clicks on the slider.
Thanks to Tony's solution found here ( www.limesurvey.org/de/forum/can-i-do-thi...ser-clicks-on-slider ) I was able to do so.
Playing with that approach I found a significant drawback which I would love to solve:
1. Just imagine you have a question containing 20 mandatory sliders.
2. A participant answers 19 sliders but accidentally misses a single one.
3. After clicking "Next" the mandatory error message appears (with the page reloaded).
4. Now all sliders are hidden again (even the sliders already answered), so the participant thinks s(he) has to answer all sliders again (which is not the case as the values have been stored).
Any ideas how to circumvent that behaviour, e. g. by
- showing the handles of the sliders already answered or
- hiding those answered sliders completely or
- deactivating the "next"-button until ALL sliders have been answered or
- ...?
Thanks in advance!
Hella
I wanted to include sliders in my survey with hidden handle by default until user clicks on the slider.
Thanks to Tony's solution found here ( www.limesurvey.org/de/forum/can-i-do-thi...ser-clicks-on-slider ) I was able to do so.
Playing with that approach I found a significant drawback which I would love to solve:
1. Just imagine you have a question containing 20 mandatory sliders.
2. A participant answers 19 sliders but accidentally misses a single one.
3. After clicking "Next" the mandatory error message appears (with the page reloaded).
4. Now all sliders are hidden again (even the sliders already answered), so the participant thinks s(he) has to answer all sliders again (which is not the case as the values have been stored).
Any ideas how to circumvent that behaviour, e. g. by
- showing the handles of the sliders already answered or
- hiding those answered sliders completely or
- deactivating the "next"-button until ALL sliders have been answered or
- ...?
Thanks in advance!
Hella
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
8 years 10 months ago #120955
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 Problem with mandatory sliders and hidden handles
Try this:
Code:
$(document).ready(function() { // Initial slider handle states $('.ui-slider').each(function(i){ var thisItem = $(this).closest('.answer-item'); if($('input.text', thisItem).val() == '') { $('.ui-slider-handle', thisItem).hide(); } }); // Listener on the sliders $('.ui-slider').mousedown(function(){ $('.ui-slider-handle', this).show(); }); });
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: HellaHepp
The topic has been locked.
- HellaHepp
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
8 years 10 months ago #120960
by HellaHepp
Replied by HellaHepp on topic Problem with mandatory sliders and hidden handles
Hi Tony!
I tried your code and... (*drum roll*)... it works! :woohoo:
Thank you so much!
Best regards
Hella
I tried your code and... (*drum roll*)... it works! :woohoo:
Thank you so much!
Best regards
Hella
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
8 years 8 months ago #123354
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Problem with mandatory sliders and hidden handles
Is there a working link to the original thread. The search function didn't brought up a hit.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11655
- Thank you received: 2740
8 years 8 months ago #123359
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Problem with mandatory sliders and hidden handles
www.google.com.br/search?q=site%3Alimesu...ome&es_sm=0&ie=UTF-8
I guess it is this one: www.limesurvey.org/en/forum/can-i-do-thi...ser-clicks-on-slider
I guess it is this one: www.limesurvey.org/en/forum/can-i-do-thi...ser-clicks-on-slider
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.