Styling radio elements as checkboxes and vice versa

Plus d'informations
il y a 4 mois 3 semaines #182609 par tpartner

So, I was asked to change radio buttons to checkboxes buttons for design consistency. But it doesn't look nice with CSS.

Add something like this to the question source - this will allow you to pick up most of the core style rules for the check-boxes.

(the styles could be placed in custom.css instead of in the question source)

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
		$('#question{QID}').addClass('with-checkboxes');
		$('#question{QID} .radio-item').removeClass('radio-item').addClass('checkbox-item');
	});	
</script>
<style type="text/css">
	.list-radio.with-checkboxes .checkbox-item {
		padding-left: 3px;
	}
	.list-radio.with-checkboxes .checkbox-item input[type="radio"]:indeterminate + label::after {
		display: none;
	}
</style>

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é: krosser

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

Plus d'informations
il y a 4 mois 3 semaines #182620 par krosser
This works nicely, Tony. Many thanks!

I'm using the latest LS 3.17 hosted on LS servers, not installed locally.

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!