Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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