Tuesday, November 20, 2012

MooTools More Form.Validator Serial Option Doesn't Do What You Think It Does

MooTools More is pretty great. It has a lot of features that make my life easier. One thing in specific is the Form.Validator class. It makes it super easy to build form validation that works in all browsers.

My one current gripe is the documentation of the serial option. It appears as if it is functioning as expected and actually writing out what it does would be far to wordy for standard documentation.

I started with my standard grade school mathematics approach. Guess and check. I change serial to true. I changed serial to false. I checked to see what it did. I didn't notice anything.

I double checked my code for errors. Nothing. I hopped on Google and found a post to the MooTools user group; Form.Validator "serial" property seems to do nothing. No replies.

Eventually I tracked down an old posting on Lighthouse (MooTools tracked bugs there before GitHub) about the serial option and that shed some light onto the face of things.

The official documentation of the feature is:

  • serial - (boolean) whether to validate other fields if one field fails validation unless the other fields' contents actually change (instead of onblur); defaults to true
A more correct documentation of the feature is:
  • serial - (boolean) whether to validate other fields if one field fails validation unless the other fields' contents actually change (instead of onblur); does not effect number of fields validated onsubmit; defaults to true
I'm pretty sure nobody is ever going to read this. None the less I'm going to post an ad to see how it looks. Ha! Commerce!



Maybe this book would have helped. Maybe not.

No comments:

Post a Comment