Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Mimic simple loop in LS

  • first
  • first's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
8 years 5 months ago #126368 by first
Mimic simple loop in LS was created by first
I tried to mimic loop functionality in LS.You can do something similar. If answer is wrong I am clicking question index via script to go back to same question and storing data of each loop iteration in a hidden question.

Attached is working LS. Tested on Version 2.06+ Build 150612 with Default template.:)


File Attachment:

File Name: limesurvey...9367.lss
File Size:17 KB

Survey Designer and Programmer
The following user(s) said Thank You: urlearl
The topic has been locked.
More
8 years 5 months ago - 8 years 5 months ago #127404 by DOwen
Replied by DOwen on topic Mimic simple loop in LS
Hey OMdev,

I'd be interested to see how you got this working! I'd like to have a button that appears at the bottom of a question group (or the last question in the group) that will take the user back to a certain page/certain question group. Would this be possible?

Just had a look at the code and it seems that everything is in the Source of the wrong answer question. But not sure which elements I would need to change to customise it to my own needs?

<script>
$(function(){
$('#movenextbtn .ui-button-text').text('Add Another Item');
var $index = $('#index').hide();
$('#movenextbtn').on('click',function(event){
event.preventDefault();
$index.find('li:contains(q1)').trigger('click');
});
});
</script>

Be great to hear back, thanks!
Last edit: 8 years 5 months ago by DOwen.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose