Problem with mandatory sliders and hidden handles

More
4 years 1 month ago #120939 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

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
4 years 1 month ago #120955 by tpartner
Try this:
	$(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.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: HellaHepp

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #120960 by HellaHepp
Hi Tony!

I tried your code and... (*drum roll*)... it works! :woohoo:

Thank you so much!

Best regards
Hella

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #123354 by jelo
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

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #123359 by holch

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!