fbpx
Welcome, Guest
Username: Password: Remember me

TOPIC: Scrolling the form to the top when there is an error

Scrolling the form to the top when there is an error 2 years 2 months ago #21253

  • hakana
  • hakana's Avatar
  • Offline
  • Junior Member
  • Posts: 27
  • Thank you received: 1
  • Karma: 0
Hello Team,

I thank you very much for this wonderful module. I just discovered something.

When there is an error, the form is not posted. If the form is too long, the error message is at the top and it is not visible to the submitter. Can you add a simple code to the form that if an error occurs page scrolls to the top? And the error alert div stays there for a very short period of time. Is there a way to keep it there for a longer period of time?

Last, when the form is duplicate or time out, the error message is not translatable. Can you ensure that it is translatable?

Kind regards,
Hakan
Last Edit: 2 years 1 month ago by hakana.
The administrator has disabled public write access.

Scrolling the form to the top when there is an error 2 years 2 months ago #21254

  • hakana
  • hakana's Avatar
  • Offline
  • Junior Member
  • Posts: 27
  • Thank you received: 1
  • Karma: 0
I added this to /template/default.php file on line 177:
complete: function(){
	$('html, body').animate({scrollTop: 0}, 'slow');
}

This solved the issue. (there should be a comma before complete starts though)
Last Edit: 2 years 2 months ago by hakana. Reason: update
The administrator has disabled public write access.

Scrolling the form to the top when there is an error 2 years 2 months ago #21257

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 4490
  • Thank you received: 647
  • Karma: 116
Hi Hakan,

Thanks for the post. I am sure it'd be useful to someone else :).

Thanks,
CHetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.
Moderators: akash, chandandeep
Time to create page: 0.296 seconds
Cron Job Starts