Autonext

More
4 years 3 months ago - 4 years 3 months ago #118022 by SurveyDennis
Autonext was created by SurveyDennis
I am using this code to skip automatically to the next question after clicking on the answer:
    <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>

All working fine if I add this code per question.
However is there are more clever way how I could apply this to all questions in the survey by using this for example in my template?

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com
Last edit: 4 years 3 months ago by SurveyDennis.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
4 years 3 months ago #118024 by Ben_V
Replied by Ben_V on topic Autonext

SurveyDennis wrote: However is there are more clever way how I could apply this to all questions in the survey by using this for example in my template?

you can try to paste this code into your question.pstpl file :unsure:

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #118025 by SurveyDennis
Replied by SurveyDennis on topic Autonext
Thanks, that is indeed working.
I only face another problem - it is only executed once instead for every (list radio) question.

Any idea?

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago - 4 years 3 months ago #118026 by Ben_V
Replied by Ben_V on topic Autonext
I've tried and it's ok: the action applies to all radio questions, if question by question presented (it seems that other question types are not affected).

I used a similar code (pasted at the end of the question.pstpl file):
$(document).ready(function(){
		$('#question{QID} input.radio').change(function(){
			checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type'))
			$('#movenextbtn, #movesubmitbtn').click();
		});
	});

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 4 years 3 months ago by Ben_V.

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #118027 by SurveyDennis
Replied by SurveyDennis on topic Autonext
thanks for checking into this, I will try the question by question as well, now it was all set to group by group

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #118028 by Ben_V
Replied by Ben_V on topic Autonext
you are welcome.. the next step is maybe to hide the submit button for the radio questions :)

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #118029 by SurveyDennis
Replied by SurveyDennis on topic Autonext
yes and also to hiding the radio buttons itself, I have a workaround for that.

The autonext is not fully working yet for me, I am using the skeleton template with some adjustments.

I have also tried your code with the change instead of the click but it only works for the first question.

I will look into this more.

If you want to see the link:
Survey

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #118036 by SurveyDennis
Replied by SurveyDennis on topic Autonext
Okay I have figured out what the issue is that it sometimes works and sometimes not.

For the questions where I have a condition it will not work.
Not sure if I could work around that.

Somebody a suggestion?

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!