validate.js icon indicating copy to clipboard operation
validate.js copied to clipboard

use field.name for existing error check instead of using field.id

Open beijaflor opened this issue 9 years ago • 4 comments

fix existingError check

related issue

#173

what to fix

field.id is empty in case below, so you can't get all error in some case.

  • checkbox
  • radio
  • textarea
  • No id attribute is set

change

use field.name for check instead of using field.id

beijaflor avatar Mar 13 '16 14:03 beijaflor

I think it would be better to possibly check for both. Would you be able to demonstrate what problem this is fixing?

rickharrison avatar Mar 18 '16 03:03 rickharrison

I think it would be better to possibly check for both. Would you be able to demonstrate what problem this is fixing?

Added possibly check, and samples are below. If you don't set ID for input, it only return one ( checkbox work differently ).

http://beijaflor.github.io/validate.js/sample_original.html http://beijaflor.github.io/validate.js/sample_fixed.html

I know it's invalid html but happen often.

beijaflor avatar Mar 28 '16 14:03 beijaflor

Yep, it's very needful thing!

grimcap avatar Nov 04 '20 19:11 grimcap

i support this PR.

sashn avatar May 16 '21 22:05 sashn