Problem with mandatory sliders and hidden handles

Plus d'informations
il y a 4 ans 5 mois #120939 par 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

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 4 ans 5 mois #120955 par 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
Les utilisateur(s) suivant ont remercié: HellaHepp

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 5 mois #120960 par HellaHepp
Hi Tony!

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

Thank you so much!

Best regards
Hella

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 3 mois #123354 par 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 3 mois #123359 par 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

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!