Welcome to the LimeSurvey Community Forum

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

Automaticly next question when clicked answer

More
4 years 5 months 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.

More
4 years 5 months 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.

More
4 years 5 months 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.

More
4 years 5 months 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.

More
4 years 5 months ago #226935 by ElHeso
thanks i will try it

Please Log in to join the conversation.

More
4 years 5 months ago #226936 by ElHeso
Worked like a charm :-) thanks

Please Log in to join the conversation.

More
4 years 5 months 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.

More
4 years 5 months 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.

More
1 hour 51 minutes ago - 1 hour 51 minutes ago #275110 by Mazi

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

The JavaScript snippets discussed in this thread show how difficult it can be to maintain an auto-advance solution across different LimeSurvey versions and question types.
We have now developed Flowy, a generic LimeSurvey theme for versions 6 and 7 that handles this functionality centrally. When Auto Submit is enabled, the next question is loaded automatically after a supported question has been answered. There is no need to add or maintain individual JavaScript snippets in question texts.

Flowy supports radio buttons and Yes/No questions as requested here, as well as dropdowns, arrays, date questions and short or long text inputs.
The theme is customizable through its settings, including colors, fonts, layout and footer text.
I have attached screenshots showing the resulting survey flow and the available options.

Demo
Flowy is currently available at an introductory price at our online shop .

     

Best regards/Beste Grüße,
Dr. Marcel Minke
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
Last edit: 1 hour 51 minutes ago by Mazi.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose