Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: insert game (code) from URL before questions appear

insert game (code) from URL before questions appear 10 months 2 weeks ago #103244

  • baszek
  • baszek's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
tpartner wrote:
Ah, my code is for 2.0. In 2.05, you can use something like this:
<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
		$('#movenextbtn').click();
	});
</script>

Here is a survey you can try in 2.05:

File Attachment:

File Name: limesurvey_survey_376655.lss
File Size: 14 KB
This code works perfect! Thx a lot !
Last Edit: 10 months 2 weeks ago by baszek. Reason: some changes
The administrator has disabled public write access.

insert game (code) from URL before questions appear 2 weeks 4 days ago #114282

  • tomscher
  • tomscher's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 5
  • Karma: 2
Sorry for bumping up that old thread, but I have a similar problem:
I embed an external game in Limesurvey which should trigger the 'submit' function at the end. For that purpose, I do the following:

a) embed the game using iframe (no probs here)
b) hide the 'next' button of LS to avoid premature submissions (no probs here)
c) at the end of the game, I want to submit the LS-question group and go to the next question group (problem is here).

I have tried the following JS lines at the appropriate places (i.e. within a function that is called at the end of the game within the frame):

document.limesurvey.move.value = 'movenext';
document.limesurvey.submit();

Also not working: defining a function with the proposed "click"-Code from below in LS and calling this function (nextLSpage) from the frame using window.opener.nextLSpage();

Possibly it's a simple solution - I am just completely stuck and help is highly appreciated.

I use LS 2.05 and my first solution did work in previous versions (up from at least 1.92) - so what would be the new equivalent to automatically submit question groups from another frame?
The administrator has disabled public write access.

insert game (code) from URL before questions appear 2 weeks 4 days ago #114284

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4372
  • Thank you received: 830
  • Karma: 381
Try this in the iframe:

$('#movenextbtn', window.top.document).click();


This sets the scope in which to search for "#movenextbtn" to the top window.



.
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.
Last Edit: 2 weeks 4 days ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: tomscher

insert game (code) from URL before questions appear 2 weeks 4 days ago #114288

  • tomscher
  • tomscher's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 5
  • Karma: 2
Thank you! Works like a charm! :)
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.119 seconds
Donation Image