Welcome to the LimeSurvey Community Forum

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

Loading next page automatically upon selection of answer

  • ReenaAyodheea
  • ReenaAyodheea's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #191139 by ReenaAyodheea
Hello,

Is it possible to move to next page only after selecting answer but without clicking on next button ?
Anyone can help ?

Thank you

Regards,
Reena
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #191141 by tpartner
Yes it possible - there are many examples on the forums depending on question types.

That said, I don't think it's a good idea as it doesn't allow respondents to fix click mistakes.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ReenaAyodheea
  • ReenaAyodheea's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #191142 by ReenaAyodheea
I wanted to do it for whole survey basically for single answer question. Can you help ? could not find anything similar or could be I did not search using appropriate terms. Please note I am new to Javascripting

Thank you
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago - 4 years 5 months ago #191147 by tpartner
If you have a single list-radio type question, disable AJAX in the survey theme options and add this script to the question source:

Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
 
    $('#question{QID} input:radio[id^="answer"]').on('click', function(e) {
      $('#ls-button-submit').trigger('click');
    });
  });
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...714n.lss
File Size:17 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 5 months ago by tpartner.
The topic has been locked.
  • ReenaAyodheea
  • ReenaAyodheea's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #191149 by ReenaAyodheea
Hello,

Thank you, it works.

Regards,

Reena
The topic has been locked.
  • ReenaAyodheea
  • ReenaAyodheea's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #191150 by ReenaAyodheea
Hello,

This has to be done for every list radio button question. It cannot be done once in a template or it should be added for each single question ?

Thank you
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #191211 by tpartner
You can place this in your custom.js file:

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

Note that this will be applied to ALL list-radio questions in surveys using that theme (template).

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #191301 by DenisChenu
Inpiration : gitlab.com/SondagesPro/QuestionSettingsT...assets/autosubmit.js

must be updated to
1. 3.X version
2. Allow settings by question

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose