Popups in survey or Hide/Show help text

Plus d'informations
il y a 2 ans 5 mois - il y a 2 ans 5 mois #122597 par Matadeleo
Matadeleo a créé le sujet : Popups in survey or Hide/Show help text
Hi, I'm trying to display a couple paragraphs of text as a refresher for people completing my survey -

I've tried using a JavaScript alert but this seems to reload the page when 'OK' is clicked
I've tried using a jQuery popup but without any luck

Basically I would like to have either some text, or a button in the help section which would either 'unhide' or activate a popup containing this chunk of text. The idea is to keep the page looking neat and clean, without large chunks of text in each help section.

I'm not sure if it's possible in limesurvey, but perhaps there is some way to create a Div within the help section, which when a button/link in the help section is pressed will unhide that div?

Any suggestions on how to achieve any of these things would be greatly appreciated
Dernière édition: il y a 2 ans 5 mois par Matadeleo.

Connexion pour participer à la conversation.

Plus d'informations
il y a 2 ans 5 mois #122600 par gabrieljenik
gabrieljenik a répondu au sujet : Popups in survey or Hide/Show help text
Hi,

Have you tried creating that DIV using JQuery?

If you need that DIV for all the questions you could try omdifying the template, copying the current template and using the Template Editor.

Cheers,

Cheers,
Gabriel - www.Encuesta.Biz - Authorized Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?)....[img]

Connexion pour participer à la conversation.

Plus d'informations
il y a 2 ans 5 mois #122604 par Matadeleo
Matadeleo a répondu au sujet : Popups in survey or Hide/Show help text
Unfortunately I don't know any javascript/jquery, I usually get by, by using tutorials or example code

Connexion pour participer à la conversation.

Plus d'informations
il y a 2 ans 5 mois - il y a 2 ans 5 mois #122625 par tpartner
tpartner a répondu au sujet : Popups in survey or Hide/Show help text
Here is an example of HTML and JavaScript that, when placed in the question help, will display two buttons that open jQuery UI modal dialogs (pop-ups).

<p>
	<button class="pop-up-button pop-up-button-1" type="button">Pop-up details 1</button><br /><br />
	<button class="pop-up-button pop-up-button-2" type="button">Pop-up details 2</button>
</p>
 
<div class="dialog-message dialog-message-1">
	<p>Some text for pop-up 1...</p>
</div>
<div class="dialog-message dialog-message-2">
	<p>Some text for pop-up 2...</p>
</div>
 
<script type="text/javascript" charset="utf-8">		
	$(document).ready(function() {
 
		// Apply jQuery UI to the buttons
		$('.pop-up-button').button();
 
		// Click events for the buttons
		$('.pop-up-button-1').on('click', function(e) {
			$('.dialog-message-1').dialog('open');
		});
		$('.pop-up-button-2').on('click', function(e) {
			$('.dialog-message-2').dialog('open');
		});
 
		// Define some pop-up options
		var dialogOptions = {
			modal: true,
			autoOpen: false,
			draggable: false,
			resizable: false,
			dialogClass: 'dialog-message-wrapper',
			buttons: {
				OK: function() {
					$(this).dialog('close');
				}
			}
		};
		// Initiate the modal pop-ups
		$('.dialog-message').dialog(dialogOptions);
 
		// Hide the pop-up title bars
		$('.dialog-message-wrapper .ui-dialog-titlebar').hide();		
	});
</script>

Sample survey attached:

Fichier attaché :

Nom du fichier : limesurvey...1599.lss
Taille du ficher :13 ko

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Pièces jointes :
Dernière édition: il y a 2 ans 5 mois par tpartner.
Les utilisateur(s) suivant ont remercié: Matadeleo

Connexion pour participer à la conversation.

Plus d'informations
il y a 2 ans 4 mois #123000 par Matadeleo
Matadeleo a répondu au sujet : Popups in survey or Hide/Show help text

tpartner écrit: Here is an example of HTML and JavaScript that, when placed in the question help, will display two buttons that open jQuery UI modal dialogs (pop-ups).

<p>
	<button class="pop-up-button pop-up-button-1" type="button">Pop-up details 1</button><br /><br />
	<button class="pop-up-button pop-up-button-2" type="button">Pop-up details 2</button>
</p>
 
<div class="dialog-message dialog-message-1">
	<p>Some text for pop-up 1...</p>
</div>
<div class="dialog-message dialog-message-2">
	<p>Some text for pop-up 2...</p>
</div>
 
<script type="text/javascript" charset="utf-8">		
	$(document).ready(function() {
 
		// Apply jQuery UI to the buttons
		$('.pop-up-button').button();
 
		// Click events for the buttons
		$('.pop-up-button-1').on('click', function(e) {
			$('.dialog-message-1').dialog('open');
		});
		$('.pop-up-button-2').on('click', function(e) {
			$('.dialog-message-2').dialog('open');
		});
 
		// Define some pop-up options
		var dialogOptions = {
			modal: true,
			autoOpen: false,
			draggable: false,
			resizable: false,
			dialogClass: 'dialog-message-wrapper',
			buttons: {
				OK: function() {
					$(this).dialog('close');
				}
			}
		};
		// Initiate the modal pop-ups
		$('.dialog-message').dialog(dialogOptions);
 
		// Hide the pop-up title bars
		$('.dialog-message-wrapper .ui-dialog-titlebar').hide();		
	});
</script>

Sample survey attached:

Fichier attaché :

Nom du fichier : limesurvey...1599.lss
Taille du ficher :13 ko


Hi tpartner,

This works fantastic, exactly what I was looking for.

I noticed that this seems to not be compatible with version 2.00, only with 2.05. As I have multiple instances of limesurvey running, some of them have yet to be updated to the latest version as they have on-going surveys. Is there any way I can make this code you supplied backwards compatible with version 2.00?

Connexion pour participer à la conversation.

Plus d'informations
il y a 2 ans 4 mois #123146 par tpartner
tpartner a répondu au sujet : Popups in survey or Hide/Show help text
This will work in both 2.0 and 2.05:

<p>
	<button class="pop-up-button pop-up-button-1" type="button">Pop-up details 1</button><br /><br />
	<button class="pop-up-button pop-up-button-2" type="button">Pop-up details 2</button>
</p>
 
<div class="dialog-message dialog-message-1">
	<p>Some text for pop-up 1...</p>
</div>
<div class="dialog-message dialog-message-2">
	<p>Some text for pop-up 2...</p>
</div>
 
<script type="text/javascript" charset="utf-8">		
	$(document).ready(function() {
 
		// Apply jQuery UI to the buttons
		$('.pop-up-button').button();
 
		// Click events for the buttons
		$('.pop-up-button-1').click(function(e) {
			$('.dialog-message-1').dialog('open');
		});
		$('.pop-up-button-2').click(function(e) {
			$('.dialog-message-2').dialog('open');
		});
 
		// Define some pop-up options
		var dialogOptions = {
			modal: true,
			autoOpen: false,
			draggable: false,
			resizable: false,
			dialogClass: 'dialog-message-wrapper',
			buttons: {
				OK: function() {
					$(this).dialog('close');
				}
			}
		};
		// Initiate the modal pop-ups
		$('.dialog-message').dialog(dialogOptions);
 
		// Hide the pop-up title bars
		$('.dialog-message-wrapper .ui-dialog-titlebar').hide();		
	});
</script>

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

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #130833 par Gems1389
Gems1389 a répondu au sujet : Popups in survey or Hide/Show help text
Hi,

Sorry to be pain, I was wondering if anyone could please help. I'm trying to get this to work in my survey, however when I copy and paste it into my question help field, I just get the text that should be in the pop-ups, and no pop-up buttons. Please could someone tell me where I'm going wrong? Should I be editing it at all?

Thanks :)

P.s. I have no coding experience or Lime Survey experience, so if you could explain it like you're talking to a young child, that would be fantastic.

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #130948 par tpartner
tpartner a répondu au sujet : Popups in survey or Hide/Show help text
Here's a sample survey.

Fichier attaché :

Nom du fichier : limesurvey...-5-6.lss
Taille du ficher :14 ko

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Pièces jointes :
Les utilisateur(s) suivant ont remercié: Ben_V, Gems1389

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #130950 par Gems1389
Gems1389 a répondu au sujet : Popups in survey or Hide/Show help text

tpartner écrit: Here's a sample survey.

Fichier attaché :

Nom du fichier : limesurvey...-5-6.lss
Taille du ficher :14 ko


Thanks for your help. Unfortunately I'm having problems importing the example (should've mentioned that in my previous post). I get an error message saying:
"Internal Server Error
Property "Survey.questionindex" is not defined.
An internal error occurred while the Web server was processing your request. Please contact the webmaster to report this problem.
Thank you."

Do you know if I'm doing something wrong?

Thanks again

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #130959 par tpartner
tpartner a répondu au sujet : Popups in survey or Hide/Show help text
What LimeSurvey version?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Les utilisateur(s) suivant ont remercié: Gems1389

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #130960 par Gems1389
Gems1389 a répondu au sujet : Popups in survey or Hide/Show help text

tpartner écrit: What LimeSurvey version?


Version 2.00+ (it says Build 130213 next to that too if that is relevant).

Thanks again

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #130962 par tpartner
tpartner a répondu au sujet : Popups in survey or Hide/Show help text
You should consider updating.

Here's a 2.0 survey:

Fichier attaché :

Nom du fichier : limesurvey...67-2.lss
Taille du ficher :14 ko

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Pièces jointes :
Les utilisateur(s) suivant ont remercié: Gems1389

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #130963 par Gems1389
Gems1389 a répondu au sujet : Popups in survey or Hide/Show help text

tpartner écrit: You should consider updating.

Here's a 2.0 survey:

Fichier attaché :

Nom du fichier : limesurvey...67-2.lss
Taille du ficher :14 ko


Thanks! I've loaded that one in fine, however I'm still having the same problem. When I play the question in the help box it just says:
Pop-up details 1
Pop-up details 2
Some text for pop-up 1...
Some text for pop-up 2...

I was expecting something more like I'd hover over "pop-up details 1" and "some text for pop-up 1" would appear. But when I hover there isn't anything I can click on? Sorry if I'm misunderstanding.

Unfortunately I get the license through my employers, I'll ask them about updating.

Thanks

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #130989 par tpartner
tpartner a répondu au sujet : Popups in survey or Hide/Show help text
I can only think that something in your installation or template is causing a fatal JavaScript error. Can you activate a test survey and post a link here?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Les utilisateur(s) suivant ont remercié: Gems1389

Connexion pour participer à la conversation.

Plus d'informations
il y a 1 an 10 mois #131043 par Gems1389
Gems1389 a répondu au sujet : Popups in survey or Hide/Show help text

tpartner écrit: I can only think that something in your installation or template is causing a fatal JavaScript error. Can you activate a test survey and post a link here?



Fichier attaché :

Nom du fichier : test_limes...1867.lss
Taille du ficher :14 ko



Hi, I've added a test survey, is that right? Please let me know what you think. Thanks again :)
Pièces jointes :

Connexion 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!