Welcome to the LimeSurvey Community Forum

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

Automatically proceed to next question after selecting answer

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171522 by Joffm
Hi, siam,

it is a Javascript snippet.

So you should put it into an Javascript file, here I should say, the "custom.js" of your template is the right place.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Siem
The topic has been locked.
  • Siem
  • Siem's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 9 months ago #171523 by Siem
Thanks Joff, I put it in the Javascript file, but then I get this error:

Error: Syntax error, unrecognized expression: #question{QID} input[type="radio"]

I tried it with and without the <script> tags:
Code:
$(document).ready(function(){ 
  $('#question{QID} input[type="radio"]').on('click', function() {
    $('#ls-button-submit').trigger('click');
  });
});
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171524 by Joffm
Hi,

I put it into the question text (source code mode) and it works.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Siem
The topic has been locked.
  • Siem
  • Siem's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 9 months ago - 5 years 9 months ago #171526 by Siem

Joffm wrote: Hi,

I put it into the question text (source code mode) and it works.

Joffm


You are right, that was the trick many thanks! :)

I would like to add this code to my theme so it is automatically added to the questions, would this be possible?
It would save a lot of time, since there are multiple tests that need it.
Last edit: 5 years 9 months ago by Siem.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #171538 by tpartner
If want it to act on EVERY list-radio question in every survey using that template, add this to your theme custom.js file:

Code:
$(document).on('ready pjax:scriptcomplete',function(){ 
  $('.list-radio input[type="radio"]').on('click', function() {
    $('#ls-button-submit').trigger('click');
  });
});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Siem, NESTSurvey, joeliu916
The topic has been locked.
More
5 years 6 months ago #175426 by surveySn
Hello tpartner


I have some question,

Can this be used in Arrays?


This will hide all navigation buttons:

<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
$('#navigator-container button').hide();
});
</script>

But this code hides all next, can you hide only one problem page's next?

We look forward to your reply! Thank you.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175438 by tpartner

Can this be used in Arrays?

Can what be used? There are many script samples in this thread.

But this code hides all next, can you hide only one problem page's next?

Please explain exactly what you want to do and what you have tried.

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
5 years 6 months ago #175649 by surveySn


Can this type be used?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175650 by tpartner
That does not answer my questions.

What exactly are you trying to do?

What LimeSurvey version are you using?

What have you tried?

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
4 years 4 weeks ago - 4 years 4 weeks ago #195851 by matanzino
I am using LimeSurvey 3.22.10 (200323).
I am displaying all questions on a single page and would like to automatically proceed to the next question (for all questions).
I added your snippet for list-radio questions into the custom.js file of my current theme but it did not have any effect.
I also tried putting it directly into the source of a corresponding question - no effect either.
Any idea what I might be doing wrong?
(I checked that javascript is activated.)
Last edit: 4 years 4 weeks ago by matanzino.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 weeks ago #195853 by tpartner
Code:
I am displaying all questions on a single page and would like to automatically proceed to the next question
How can you proceed to a "next question" if they are already all displayed on the page?

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
4 years 4 weeks ago #195855 by matanzino
I am sorry, I meant to write "each question on a single page".
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose