Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Another disable "next" button question

Another disable "next" button question 1 year 4 months ago #118260

  • samarta
  • samarta's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
Hi,

Here is the test survey:
surveys.uc.pt/index.php/865947/lang-en



Thanks,


João
The administrator has disabled public write access.

Another disable "next" button question 1 year 4 months ago #118261

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6129
  • Thank you received: 1360
  • Karma: 535
Oh, I see what you're doing now.

You'll need a listener on that "Age" input. Also we can automatically detect the input so you won't need to modify the SGQA for different surveys.

Place this in the source of the "Age" question:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
 
		// Identify this question
		var thisQuestion = $('#question{QID}');
 
		$('#movenextbtn').hide();
 
		// Check the initial value of the age question
		if($('input.text', thisQuestion).val() != '' && $('input.text', thisQuestion).val() < 18){
			$('#movenextbtn').show();
		}
 
		// A listener on the age question
		$('input.text', thisQuestion).on('keyup change paste', function() {
			setTimeout(function() {
				if($('input.text', thisQuestion).val() != '' && $('input.text', thisQuestion).val() < 18){
					$('#movenextbtn').show();
				}
				else {
					$('#movenextbtn').hide();
				}
			}, 100);
		});		
	});
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: samarta

Another disable "next" button question 1 year 4 months ago #118265

  • samarta
  • samarta's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
Hi:

This is still not working im my production system (LimeSurvey Version 2.00+ Build 130406)

But I have a testing system with LimeSurvey Version 2.05+ Build 141003, and THERE it works fine.

I have to upgrade my production system.

Thank you, once again.


João
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 2.124 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form