Check out the LimeSurvey source code on GitHub!

JavaScript Problem with Next-Button

5 years 4 months ago #67136 by Veve
Hello everyone,

at the moment I'm doing a questionnaire in 1.91+.
There I need the following programmed:
After a total of 4 Minutes the question field is deactivated.
The next>>> -button is disabled for 3 minutes, after this time it is activated (so that the participants who have finished this question earlier may proceed) and there comes a warning that there is 1 minute left.

I tried programming this feature in JavaScript. However, so far only the text "Warnung" appears however the next>>> button isn't doing anything.

This is the source code I used:

<script language="JavaScript">
var Aktiv=setTimeout("warnung()",180000);//180000

function warnung(){

// End -->

What is wrong with the code? :unsure:
Is it possible to alter the next button!

Thank you very much!!


Please Log in to join the conversation.

5 years 4 months ago - 5 years 4 months ago #67163 by tpartner
I think the main problem is that you are firing the script before all page elements have been loaded.

This script uses jQuery shortcuts and also waits until the page is fully loaded before doing anything.
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('#movesubmitbtn').attr('disabled', true);
		setTimeout(function() {
		}, 180000);
		function warnung(){
			$('#movesubmitbtn').attr('disabled', false);

Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 5 years 4 months ago by tpartner.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form