Welcome to the LimeSurvey Community Forum

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

Moving automatically to next bquestion

More
10 years 3 months ago #120668 by aviben
Hello.

I am using the one question per page feature

How can I make moving automatically to the next question/page after answering one question without clicking next?

Avi
The topic has been locked.
More
10 years 3 months ago #120671 by holch
have a look in the forum, there has been a javascript solution around.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
10 years 3 months ago #120679 by tpartner
What type of question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
10 years 3 months ago #120894 by aviben
Mainly List (radio)
The topic has been locked.
More
10 years 3 months ago #120913 by DenisChenu
Hi,

I use :
Code:
$(document).ready(function(){
  $(".list-dropdown select").change(function(){
    if($(this).val()!="" && $(this).val()!="-oth-"){
      $("#movenextbtn,#movesubmitbtn").delay(300).click();
    }
  });
  $(".list-radio input[type=radio],.yes-no input[type=radio]").click(function(){
    if($(this).val()!="" && $(this).val()!="-oth-"){
      $("#movenextbtn,#movesubmitbtn").delay(300).click();
    }
  });
});

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: tpartner
The topic has been locked.
More
10 years 2 months ago #121371 by aviben
Hi,

I'm having some issues implementing the code you have provided.

I can understand what the function should do, but after I had pasted into template.js I receive an error message saying '$' is not defined, as if jQuery was not loaded - however, opening the console and typing in '$' would return a function.

This leads to believe that the problem I'm having is occurring since jquery only loads later.

Please assist.
Regards,
Avi
The topic has been locked.
More
10 years 2 months ago #121394 by aviben
Hi,

I'm having some issues implementing the code you have provided.

I can understand what the function should do, but after I had pasted into template.js I receive an error message saying '$' is not defined, as if jQuery was not loaded - however, opening the console and typing in '$' would return a function.

This leads to believe that the problem I'm having is occurring since jquery only loads later.

Please assist.
Regards,
Avi
The topic has been locked.
More
10 years 2 months ago #121405 by tpartner
This looks like template.js is being loaded in the wrong position. What template LimeSurvey version and template are yo using?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
10 years 2 months ago #121440 by Mazi
Please post a link to an activated sample survey so we can have a look at the details.

Best regards/Beste Grüße,
Dr. Marcel Minke
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
The topic has been locked.
More
10 years 2 months ago #121506 by aviben
Attached a print screen of the template (limeinspired) and the js portion that should raise the event

Survey Url: metrics-institute.com/LimeSurvey/index.php/715141/lang-he

Thanks
The topic has been locked.
More
10 years 2 months ago #121508 by tpartner
What LimeSurvey version are you using?

That doesn't look like a copy of an up-to-date template. The limespired template inserts template.js in the <head> element, your template inserts it in the <body>. Please try copying one of the shipped templates.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
10 years 2 months ago #121603 by aviben
Thanks. It works great for radio type questions. How can I make it work for an array type question?

For each question I create another array with a semantic scale (see attached), a regular array question with a "|" separator

Thanks
The topic has been locked.
More
10 years 2 months ago #121604 by Mazi
In general this will be far more difficult for array questions because you need to count the number of items and based on that, auto-redirect once each item was assigned an answer.

In this case, since you only seem to list one item, this may work with some code adjustments.
Maybe Tony can help if you provide a link to an activated sample survey with that question only.

Best regards/Beste Grüße,
Dr. Marcel Minke
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
The topic has been locked.
More
10 years 2 months ago #121605 by tpartner
This should work for radio arrays:

Code:
$(document).ready(function(){
 
  $('tr.radio-list input.radio').bind('click', function () {      
    var thisArray = $(this).closest('table');
    if($('input.radio:checked', thisArray).length == $('tr.radio-list', thisArray).length) {
      $("#movenextbtn,#movesubmitbtn").delay(300).click();
    }
  });
});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
10 years 2 months ago #121644 by aviben
Perfect!!!
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose