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

TOPIC: Disabling 'next' button on a question page in v1.91

Disabling 'next' button on a question page in v1.91 5 years 1 month ago #63734

  • doodsonj
  • doodsonj's Avatar
  • Offline
  • Junior Lime
  • Posts: 30
  • Thank you received: 2
  • Karma: 2
Hi team,

I was wondering if anybody had the code to disable and/or hide the 'next' button on the question page. I've got some code which would check an answer matches a relevant value, and that works all fine. When there is a match, I want to either disable or hide the 'next' button (or any other button as I choose).

This would have to go in the source of a question. I've recycled the code from the 'Require users to check a box agreeing to privacy statement before registering for a survey' workaround (docs.limesurvey.org/tiki-index.php?page=...ayout+and+templating).

However, putting the following code into the source of a question does not work. Any ideas if I can disable the next button?

<script type="text/javascript" charset="utf-8">

$(document).ready(function() {
document.getElementByID('movenext').disabled = false;
);
</script>


Any ideas would be helpful.

Thanks,

J.

P.S. The registerpage workaround above seems to have broken since upgrading to v 1.91 so is it something to do with the workaround itself?
The administrator has disabled public write access.

Disabling 'next' button on a question page in v1.91 5 years 1 month ago #63737

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6221
  • Thank you received: 1379
  • Karma: 539
To hide it:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
			$('#movenextbtn').hide();
 
	});
 
</script>

And to disable:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
			$('#movenextbtn').attr('disabled', 'disabled');
 
	});
 
</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: doodsonj

Disabling 'next' button on a question page in v1.91 5 years 1 month ago #63738

  • doodsonj
  • doodsonj's Avatar
  • Offline
  • Junior Lime
  • Posts: 30
  • Thank you received: 2
  • Karma: 2
Excellent, thanks Tony. Ever so simple and exactly what I wanted. I have now plugged it into my script and it works perfectly.

Thanking you,

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