Skip to content

Conversation

beijaflor
Copy link

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

@rickharrison
Copy link
Owner

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

beijaflor added a commit to beijaflor/validate.js that referenced this pull request Mar 28, 2016
@beijaflor
Copy link
Author

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.

@grimcap
Copy link

grimcap commented Nov 4, 2020

Yep, it's very needful thing!

@sashn
Copy link

sashn commented May 16, 2021

i support this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants