- Posts: 7
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How do I hide or disable answer options after a certain time?
- Danke
- Topic Author
- Offline
- New Member
Less
More
5 years 10 months ago #169444
by Danke
How do I hide or disable answer options after a certain time? was created by Danke
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.
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.
The topic has been locked.
- Danke
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
5 years 10 months ago #169596
by Danke
Replied by Danke on topic How do I hide or disable answer options after a certain time?
Leeeeemoooons? Aaaaaare youuuuuuu theeeere?
I am grateful for every hint!!
I am grateful for every hint!!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 10 months ago #169629
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic 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.
The topic has been locked.
- Danke
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
5 years 10 months ago #169638
by Danke
Replied by Danke on topic 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)...
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)...
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 10 months ago #169639
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic 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.
The topic has been locked.
- Danke
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
5 years 10 months ago #169641
by Danke
Replied by Danke on topic 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).
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).
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 10 months ago #169708
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic 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)?
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.
The topic has been locked.
- Danke
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
5 years 10 months ago #169715
by Danke
Replied by Danke on topic 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!
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 10 months ago #169717
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic 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.
Code:
<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.
The topic has been locked.