Welcome, Guest
Username: Password: Remember me

TOPIC: Hide next subquestion until current one is answered

Hide next subquestion until current one is answered 1 year 10 months ago #87712

  • coeneisma
  • coeneisma's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 22
  • Thank you received: 2
  • Karma: 1
Hi all,

Small question, searched but couldn't find the answer. Is it possible to hide the next subquestion untill any data is putt in the current one?

Got a question with 30 or so subquestions (multiple short questions, see attachment), and to keep the survey clean I want to hide all inputfields until the previous one is given.

Thanks in advance!
Attachments:
The administrator has disabled public write access.

Re: Hide next subquestion until current one is answered 1 year 10 months ago #87717

  • coeneisma
  • coeneisma's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 22
  • Thank you received: 2
  • Karma: 1
btw, language is set to dutch in attached lsg-file
The administrator has disabled public write access.

Re: Hide next subquestion until current one is answered 1 year 10 months ago #87727

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6334
  • Thank you received: 818
  • Karma: 243
There are non included function in LimeSurvey.

You have to look at workarounds if you found something like this.

Maybe that one : docs.limesurvey.org/Workarounds%3A+Manip...exible_Text_question
The administrator has disabled public write access.

Re: Hide next subquestion until current one is answered 1 year 10 months ago #87758

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4193
  • Thank you received: 789
  • Karma: 359
Or, as a simplified version of that workaround, you could add this to the source of the question. This script will hide all multiple-short-txt answers except the first one and then as a value is entered in each, the next one is shown.
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		$('.multiple-short-txt ul.subquestions-list li').hide();
		$('.multiple-short-txt ul.subquestions-list li:first').show();
		$('.multiple-short-txt ul.subquestions-list input.text').keyup(function(){
			if($(this).val() !== '') {
				$(this).parents('li:eq(0)').next('li').show();
			}
		});
 
	});
 
</script>

Here's a sample survey with the code in the first question of your group.

File Attachment:

File Name: limesurvey_survey_717646.lss
File Size: 53 KB
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.

Re: Hide next subquestion until current one is answered 1 year 10 months ago #87781

  • coeneisma
  • coeneisma's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 22
  • Thank you received: 2
  • Karma: 1
Thanks a lot guys! Cheers!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.118 seconds
Donation Image