segmentio / validate-form

Easily validate a form element against a set of rules.
43 stars 6 forks source link

Allow Per-Field Config (value, valid, invalid, etc) #6

Open dominicbarnes opened 10 years ago

dominicbarnes commented 10 years ago

It would be great if I could define configuration (e.g. value, valid and invalid callbacks) for individual fields.

This would be especially helpful when mixing vanilla form elements with things like yields/select or other highly interactive components. (that don't expose a .value() method)

ianstormtaylor commented 10 years ago

nice, yeah im down. i think it would just involve wrapping the current field adapter setting in clone and then exposing the same functions on the fields to as is on the form. happy to merge it in

dominicbarnes commented 10 years ago

I'll be needing this here at work, so I'll probably send a couple PRs your way tomorrow or next week.