Welcome, Guest
Username: Password: Remember me

TOPIC: Show hidden question when button is pressed

Show hidden question when button is pressed 3 months 1 week ago #103266

  • baszek
  • baszek's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
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.
The administrator has disabled public write access.

Show hidden question when button is pressed 3 months 1 week ago #103282

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Show hidden question when button is pressed 3 months 1 week ago #103284

  • baszek
  • baszek's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
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.
.
I was trying with that code, which I found at this forum:
$('#questionQQ').hide();
where QQ is my question id, but it does not work.
Last Edit: 3 months 1 week ago by baszek.
The administrator has disabled public write access.

Show hidden question when button is pressed 3 months 1 week ago #103288

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
This will work if you use the correct ID:
Capture2_2014-01-09.PNG


If your script is placed in the source of the hidden question, you can use the {QID} placeholder:
<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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Show hidden question when button is pressed 3 months 1 week ago #103289

  • baszek
  • baszek's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
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 administrator has disabled public write access.

Show hidden question when button is pressed 3 months 1 week ago #103291

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Show hidden question when button is pressed 3 months 1 week ago #103292

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.176 seconds
Donation Image