judgegem / judge

Client-side form validation for Rails
MIT License
256 stars 41 forks source link

Move confirmation validation to confirmation field #55

Closed jamesmk closed 9 years ago

jamesmk commented 9 years ago

This PR fixes #53: The data-validate for confirmation get's attached to the original field. This makes for a bad user experience if you're triggering validations on blur. The solution would be to attached the data-validate to the confirmation field.

I've stripped out confirmation validation on the original object and applied a validation like object to the confirmation field. This ConfirmationValidator references the original validator and passes along it's kind and options methods, which are required in Judge::Validator.

@joecorcoran @dannysperry @saurabhbhatia I'd appreciate any feedback you have!

thanks

jamesmk commented 9 years ago

@dannysperry good catch, fixed.

joecorcoran commented 9 years ago

This is excellent – much needed. :100: