judgegem / judge

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

Confirmation validation should be applied to the confirmation field #53

Closed jamesmk closed 9 years ago

jamesmk commented 9 years ago

When applying confirmation validation:

validates :password, confirmation: true

The data-validate get's attached to the original field. This makes for a bad user experience if you're triggering validations on blur. When you fill out the original field and tab to the confirmation an error will be triggered before you get a chance to fill out the confirmation.

There are ways to hack a fix with JS, but I think a better solution would be to attach the data-validate to the confirmation field by default.

I plan on looking into this an submitting a PR, but I thought I'd add an issue in case someone wanted to tackle it first or tell me why it's a bad idea.

thanks

theisof commented 9 years ago

I'm having the same issue so I think it's a good idea.

joecorcoran commented 9 years ago

Would be great if you could tackle this – it's something that has been needed for a while.

:+1:

saurabhbhatia commented 9 years ago

:+1: I would be happy to do a code review for this.