Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : border around 3 questions

border around 3 questions il y a 1 an 6 mois #92313

  • adishardis
  • Portrait de adishardis
  • Hors ligne
  • Senior Lime
  • Messages : 58
  • Karma: 0
Hi, I have a client that insists on a multiple choice question, with the choices in columns.

What I did was to divide the question into two multiple choice and float them to make them sit beside eachother and actually a third above them with description, like this:

(I added the border in the picture in photoshop to clarify what I'm after :)

border.png


Now they insist on having a border around them but I dont know how to make this. I would like a wrapping div and set border:solid 2 green, but since they are three seperate questions I'm stumped.

In this group there are questions above and depending on the choice made above there can be more questions below these three...

Any insight next couple of hours would be swell, any help to get me going in the right direction would be greatly appreciated!

Take care
Adam
L'administrateur a désactivé l'accès en écriture pour le public.

Re: border around 3 questions il y a 1 an 6 mois #92387

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 4134
  • Remerciements reçus 766
  • Karma: 347
Add the following script to the source of the first question. It will wrap it and the next question in a <div class="insertedWrapperDiv"> element.
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		// Add a class to this and the next question
		$('#question{QID}').addClass('divWrapped');
		$('#question{QID}').nextAll('div[id^="question"]:eq(0)').addClass('divWrapped');
 
		// Wrap the two questions in a div
		$('.divWrapped').wrapAll('<div class="insertedWrapperDiv" />');
 
	});
</script>

And then add something like this to the end of template.css to style the div:
.insertedWrapperDiv {
	border: 2px solid green;
}
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
L'administrateur a désactivé l'accès en écriture pour le public.

Re: border around 3 questions il y a 1 an 6 mois #92388

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 4134
  • Remerciements reçus 766
  • Karma: 347
Sorry, I missed the bit about the third question. Use this script for 3 questions:
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		// Add a class to this and the next 2 questions
		$('#question{QID}').addClass('divWrapped');
		$('#question{QID}').nextAll('div[id^="question"]:eq(0)').addClass('divWrapped');
		$('#question{QID}').nextAll('div[id^="question"]:eq(1)').addClass('divWrapped');
 
		// Wrap the three questions in a div
		$('.divWrapped').wrapAll('<div class="insertedWrapperDiv" />');
 
	});
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
L'administrateur a désactivé l'accès en écriture pour le public.
Cet utilisateur a été remercié pour son message par: adishardis

Re: border around 3 questions il y a 1 an 6 mois #92391

  • adishardis
  • Portrait de adishardis
  • Hors ligne
  • Senior Lime
  • Messages : 58
  • Karma: 0
Thanks, you're a star!! :)
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.151 secondes
Donation Image