infinitered/rmq — pull request #89 by GantMan (2014-08-02 20:43:03+00:00)
Title: Added allow_blank for optional inputs

EXAMPLE: you could have a "input your weight" field that is optional.

If the user inputs a value, you want to make sure it's a number, but validation fails if they never enter anything. So toss on an `allow_blank: true` in the options, to allow the field to validate correctly ONLY when the field has data.

This is backwards from jQuery, which defaults to allowing blanks, and depends on you to demand presence on everything... which will get quite noisy. I feel this is much more succinct, and people will not get that frustrating "O look it validated the form with all blanks" moment. I also feel "allow_blank" makes simple sense, and will be a simple/readable solution.