Welcome to the LimeSurvey Community Forum

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

Automaticly next question when clicked answer

  • ElHeso
  • ElHeso's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 weeks ago #226930 by ElHeso
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.3.7
Own server or LimeSurvey hosting: Own
Survey theme/template: fruity
==================
Is there a way to use javascript so when they click an answer Yes/No they automaticly see next question?
Is there a way to use javascript so when they click an answer on Radio button they automaticly see next question?

Best would be regardless of one of this question type it automaticly show next question

I found for earlier limesurvey versions but when i test the solutions it does not work for me

Regards
Tony

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 weeks ago #226931 by Joffm
Hi,
which solutions did you test?

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • ElHeso
  • ElHeso's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 weeks ago #226932 by ElHeso
example
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){

$('#question{QID} input.radio').click(function() {
checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type'))
$('#movenextbtn, #movesubmitbtn').trigger('click');
});
});
</script>

or

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

or

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){

$('#question{QID} input.radio').click(function() {
checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type'));
$('#movenextbtn, #movesubmitbtn').trigger('click');
});

$('#question{QID} .label-clickable').unbind();
$('#question{QID} .label-clickable').click(function() {
$('#question{QID} input.radio').unbind();
var input = $(this).parent().find('input.radio');
$(input).trigger('click');
checkconditions($(input).attr('value'), $(input).attr('name'), $(input).attr('type'));
$('#movenextbtn, #movesubmitbtn').trigger('click');
});
});
</script>

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 weeks ago #226933 by Joffm
Hi,
in this - really long - thread you find everything you need.
[url] forums.limesurvey.org/forum/can-i-do-thi...ecting-answer#149263 [/url]

You always have to consider the age of a thread and for which version a solution is provided.
And you should investigate your question with a webdevelopment tool (included in any modern browser (F12)).
Then you see that the ID of the "Next"- button now is "ls-button-submit".
It was "movenextbtn" till version 2.73.

So here you find the usual solution for list(radio)
[url] forums.limesurvey.org/forum/can-i-do-thi...swer?start=15#164553 [/url]
Code:
<script type="text/javascript" charset="utf-8">
    $(document).ready(function(){ 
        $('#question{QID} input[type="radio"]').on('click', function() {
            $('#ls-button-submit').trigger('click');
        });
    });    
</script>

And here for a Yes/No question
[url] forums.limesurvey.org/forum/can-i-do-thi...swer?start=45#215007 [/url]
Code:
<script type="text/javascript" data-author="Tony Partner">    
    $(document).on('ready pjax:scriptcomplete',function(){
        $('#question{QID} :radio').on('change', function(e) {
            $('#ls-button-submit').trigger('click');
        });
    });
</script>

This last snippet also works for bootstrap buttons, and also for list(radio). So you may use it for all of them.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • ElHeso
  • ElHeso's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 weeks ago #226935 by ElHeso
thanks i will try it

Please Log in to join the conversation.

  • ElHeso
  • ElHeso's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 weeks ago #226936 by ElHeso
Worked like a charm :-) thanks

Please Log in to join the conversation.

  • ElHeso
  • ElHeso's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 weeks ago #226945 by ElHeso
Hi again is there any way to hide next button on the questions where i now have auto to next question? so it is only where they have multiple answers

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 weeks ago #226950 by Joffm
See here.
You may neglect the "timeout" part.
[url] forums.limesurvey.org/forum/can-i-do-thi...utton?start=0#223119 [/url]

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose