Welcome, Guest
Username: Password: Remember me

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

Disabling 'next' button on a question page in v1.91 3 years 4 days 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.

Re: Disabling 'next' button on a question page in v1.91 3 years 3 days ago #63737

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4050
  • Thank you received: 740
  • Karma: 341
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: doodsonj

Re: Disabling 'next' button on a question page in v1.91 3 years 3 days 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.106 seconds
Donation Image