Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Form.Validator + Element.Delegate (1.4.2) cause superflous .fireEvent("change") on inputs #1080

Closed
DimitarChristoff opened this Issue · 2 comments

1 participant

@DimitarChristoff
Collaborator

This has wasted the better part of 2 days of debugging until I isolated it and found it was a mootools-more problem.

http://jsfiddle.net/9PWXH/2/show/

Very simple setup. form, validated. on the submit event, all the fields that are being validated fire a change event in IE7 and IE8. No other browser does this.

var validator = new Form.Validator.Inline(document.getElement("form"), {
    evaluateFieldsOnBlur: false,
    evaluateFieldsOnChange: false    
});

It is not the resetField method that causes it but if you select a single radio and then click it, it triggers because of the blur.

if you play with it some in IE8 with developer tools on (console), you will notice the change event fires under many different circumstances but it always fires a lot when you press submit on the form.

this is causing a big issue for me as we do validation and branching / dependencies checks on change and blur as well as helpers...

@DimitarChristoff
Collaborator

I have isolated this to mootools-core and removeClass: http://jsfiddle.net/cW3jJ/12/

pressing submit in IE8 will perform $("dom").removeClass("validation-failed") - which fires the element.onChange for the radio. you can confirm this by removing the resetField method on the validator.

@DimitarChristoff
Collaborator

raised as an issue in -core: mootools/mootools-core#2170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.