Scrolling to mandatory question errors

More
4 years 6 months ago #93311 by psoo
psoo created the topic: Scrolling to mandatory question errors
Hi,

When filling in the survey a respondent skips a mandatory question and advances to next group (or submits the survey) - Limesurvey outputs errors to non-filled questions (or popup, if configured accordingly); does anybody know is it possible to configure LS to scroll automatically to a specific non-filled questions that caused the error?

Many thanks for any kind of feedback!

Please Log in to join the conversation.

More
4 years 6 months ago #93474 by tpartner
tpartner replied the topic: Scrolling to mandatory question errors
Try adding this to the end of template.js:
$(document).ready(function() {
 
	if($('.errormandatory').length > 0) {
		$('html, body').animate({
			scrollTop: $('.errormandatory:first').offset().top
		}, 2000);
	}
});

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 6 months ago #93527 by Ben_V
Ben_V replied the topic: Scrolling to mandatory question errors
Hello Tony,
Is it possible in the same time to disable the original prompt alert?

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 to join the conversation.

More
4 years 6 months ago #93529 by DenisChenu
DenisChenu replied the topic: Scrolling to mandatory question errors

Ben_V wrote: Hello Tony,
Is it possible in the same time to disable the original prompt alert?

Use not know $showpopups in optional arry setting.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: Ben_V

Please Log in to join the conversation.

More
4 years 6 months ago #93532 by Ben_V
Ben_V replied the topic: Scrolling to mandatory question errors
Thank you Denis,
$showpopups added to my list of completly forgotten useful optional settings!

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 to join the conversation.

More
4 years 6 months ago #93884 by sys_sby01
sys_sby01 replied the topic: Scrolling to mandatory question errors
Hello tpartner,

I need help and information,
where i can find class/ function file located for ('.errormandatory')?
Hoping i can to use javaScript for custom display

Thank you

Regards
sys_sby

Please Log in to join the conversation.

More
4 years 6 months ago #93906 by tpartner
tpartner replied the topic: Scrolling to mandatory question errors
Already asked and answered in your other post.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now