Automatically proceed to next question after selecting answer

More
4 months 2 weeks ago #171522 by Joffm
Joffm replied the topic: Automatically proceed to next question after selecting answer
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

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

More
4 months 2 weeks ago #171523 by Siem
Siem replied the topic: Automatically proceed to next question after selecting answer
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:
$(document).ready(function(){ 
	$('#question{QID} input[type="radio"]').on('click', function() {
		$('#ls-button-submit').trigger('click');
	});
});

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

More
4 months 2 weeks ago #171524 by Joffm
Joffm replied the topic: Automatically proceed to next question after selecting answer
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

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

More
4 months 2 weeks ago - 4 months 2 weeks ago #171526 by Siem
Siem replied the topic: Automatically proceed to next question after selecting answer

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: 4 months 2 weeks ago by Siem.

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

More
4 months 2 weeks ago #171538 by tpartner
tpartner replied the topic: Automatically proceed to next question after selecting answer
If want it to act on EVERY list-radio question in every survey using that template, add this to your theme custom.js file:

$(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

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

More
1 month 3 weeks ago #175426 by surveySn
surveySn replied the topic: Automatically proceed to next question after selecting answer
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.

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

More
1 month 3 weeks ago #175438 by tpartner
tpartner replied the topic: Automatically proceed to next question after selecting answer

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.

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

More
1 month 2 weeks ago #175649 by surveySn
surveySn replied the topic: Automatically proceed to next question after selecting answer


Can this type be used?
Attachments:

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

More
1 month 2 weeks ago #175650 by tpartner
tpartner replied the topic: Automatically proceed to next question after selecting answer
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.

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!