This project is archived and is in readonly mode.

#472 ✓resolved
A. Gideonse

Scrolling malfunction in Form.Validator.Inline

Reported by A. Gideonse | December 30th, 2010 @ 02:04 AM | in

When using the default method on a long page with a form with multiple fields, I noticed that I was scrolled up about 1 centimeter while 20 centimeter was required to reach the validated field; disabling the scrolling seemed less awkward for the users in the end.

In addition, the current method seems to scroll to the error message that is (by default) placed under the field. It would be better to scroll to the validated field itself which would show the field immediately to users and give developers the ability to use the scrolling method feature while disabling the messages when extending the class (or using the 'options' when calling Validator.Inline):

var MyValidator = new Class({

   Extends: Form.Validator.Inline,

   initialize: function(form, options) {

      options = options ? options : {};

      options.onElementFail = function(el, check) {
         // Customized method for showing 'fail message'

      options.onElementPass = function(el) {
         // Customized method for hiding 'fail message'

      // Disables the Validator.Inline messages, should still scroll though
      options.showError = function() {}

      this.parent(form, options);


Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions