- Posts: 9
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Show hidden question when button is pressed
- baszek
- Topic Author
- Offline
- New Member
Less
More
10 years 2 months ago #103266
by baszek
Show hidden question when button is pressed was created by baszek
Is it possible to show/reavel previously hidden question with button press.
I know that I can make button with java script and found the way to hide question -> with option in advanced tab ->"always hide this question" set to yes.
I dont know how to show/reveal now that question in button action with javascript.
I know that I can make button with java script and found the way to hide question -> with option in advanced tab ->"always hide this question" set to yes.
I dont know how to show/reveal now that question in button action with javascript.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
10 years 2 months ago #103282
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 Show hidden question when button is pressed
You cannot hide the question with the advanced setting - this prevents the question from being rendered in the document so it can never be shown. You will need to initially hide the question with CSS or JavaScript.
.
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- baszek
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
10 years 2 months ago - 10 years 2 months ago #103284
by baszek
where QQ is my question id, but it does not work.
Replied by baszek on topic Show hidden question when button is pressed
I was trying with that code, which I found at this forum:tpartner wrote: You cannot hide the question with the advanced setting - this prevents the question from being rendered in the document so it can never be shown. You will need to initially hide the question with CSS or JavaScript.
.
Code:
$('#questionQQ').hide();
Last edit: 10 years 2 months ago by baszek.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
10 years 2 months ago #103288
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 Show hidden question when button is pressed
This will work if you use the correct ID:
If your script is placed in the source of the hidden question, you can use the {QID} placeholder:
If your script is placed in the source of the hidden question, you can use the {QID} placeholder:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#question{QID}').hide(); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The topic has been locked.
- baszek
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
10 years 2 months ago #103289
by baszek
Replied by baszek on topic Show hidden question when button is pressed
Thx - its working, but is it possible now to reveal/show that hidden question from code of other question (which is in the same group)?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
10 years 2 months ago #103291
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 Show hidden question when button is pressed
Sure but the code would vary a little depending on question types and positions. Can you attach a small survey with that group and indicate where you want the button and which question is to be hidden?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
10 years 2 months ago #103292
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 Show hidden question when button is pressed
Oh, and what version of LS are you using?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.