How do I hide or disable answer options after a certain time?

Mehr
5 Monate 1 Woche her #169444 von Danke
Danke erstellte das Thema How do I hide or disable answer options after a certain time?
Hello Limesurvey-Team,


I want to hide (or disable) radio buttons 10 seconds after the question is loaded.

I used the following skript in a former study (it worked fine; now I am using Version 2.71.1+170927 ):


</script><script type = "text/javascript" charset = "utf-8">

$(document).ready(function() {

setTimeout(function() {

$('#answer828677X2577X12206SQ003').attr("hidden", true);

}, 11000);

});


</script>


It seems that the "hidden"-command isn't working any more. The problem with the "disabled"-command (which is working) is that the answers aren't stored.

Does anyone have an idea what I could try? That would be great! Thank you very much in advance.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
5 Monate 6 Tage her #169596 von Danke
Danke antwortete auf das Thema: How do I hide or disable answer options after a certain time?
Leeeeemoooons? Aaaaaare youuuuuuu theeeere?

I am grateful for every hint!!

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
5 Monate 5 Tage her #169629 von tpartner
tpartner antwortete auf das Thema: How do I hide or disable answer options after a certain time?
This is a little more complicated than it seems. What happens if someone has already selected that radio?

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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
5 Monate 5 Tage her #169638 von Danke
Danke antwortete auf das Thema: How do I hide or disable answer options after a certain time?
Thank you, for your reply tpartner!

If I use the "disabled"-command - the command works: the buttons are disabled after a time criterion, and it looks as if the answers would be "locked" (Picture 1) - but they are not stored (there are no entries in the data file). I actually had this problem before in an older limesurvey-version - and then used the "hidden"-command, which isn't working anymore (the radios are not hidden)...
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
5 Monate 5 Tage her #169639 von tpartner
tpartner antwortete auf das Thema: How do I hide or disable answer options after a certain time?
You haven't answered my question. What do you want to do if a radio has already been selected?

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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
5 Monate 5 Tage her #169641 von Danke
Danke antwortete auf das Thema: How do I hide or disable answer options after a certain time?
Hmm... I am not quite sure if I understand your question.

I want the question to work like a "classic" multiple selection question - with a time criterion (no changes should be possible after 10 s). So, If a radio has been selected - this should be stored as an answer (or one of the multiple answers).

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
5 Monate 2 Tage her #169708 von tpartner
tpartner antwortete auf das Thema: How do I hide or disable answer options after a certain time?
I'm confused. You say "multiple selection question" but radios are for single-choice questions.

Can you attach a small sample survey containing only the pertinent question(s)?

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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
5 Monate 2 Tage her #169715 von Danke
Danke antwortete auf das Thema: How do I hide or disable answer options after a certain time?
Yes - sorry! It is a "multiple selection question"... Thank you very much for your help!

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
5 Monate 2 Tage her #169717 von tpartner
tpartner antwortete auf das Thema: How do I hide or disable answer options after a certain time?
Okay, I think the solution is simply to re-enable the check-boxes when the "Next" button is clicked.

<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		setTimeout(function() {
			$('#question{QID} input:checkbox').prop('disabled', true);
		}, 11000);
 
		$('#movenextbtn, #moveprevbtn, #movesubmitbtn').on('click', function(e) {
			$('#question{QID} input:checkbox').prop('disabled', false);
		});
	});
</script>

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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha