Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Scrolling to mandatory question errors

Scrolling to mandatory question errors 3 years 9 months ago #93311

  • psoo
  • psoo's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
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!
The administrator has disabled public write access.

Scrolling to mandatory question errors 3 years 8 months ago #93474

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
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.
The administrator has disabled public write access.

Scrolling to mandatory question errors 3 years 8 months ago #93527

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1894
  • Thank you received: 469
  • Karma: 118
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
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.

Scrolling to mandatory question errors 3 years 8 months ago #93529

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9580
  • Thank you received: 1374
  • Karma: 390
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 (use private message).
The administrator has disabled public write access.
The following user(s) said Thank You: Ben_V

Scrolling to mandatory question errors 3 years 8 months ago #93532

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1894
  • Thank you received: 469
  • Karma: 118
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
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.

Scrolling to mandatory question errors 3 years 8 months ago #93884

  • sys_sby01
  • sys_sby01's Avatar
  • Offline
  • Junior Lime
  • Posts: 26
  • Karma: 0
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
The administrator has disabled public write access.

Scrolling to mandatory question errors 3 years 8 months ago #93906

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
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.
The administrator has disabled public write access.
Time to create page: 0.308 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form