-
Notifications
You must be signed in to change notification settings - Fork 24
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
Using watch, validation message spans aren't added to the register if new fields are added to form #70
Comments
If I'm understanding correctly, this is what #65 is meant to solve. You might try that branch and see if it resolves your issue? |
Just need @haacked to |
Just published! https://www.npmjs.com/package/aspnet-client-validation/v/0.8.16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem is that the root passed to ValidationService.prototype.scanMessages = function (root, remove) is the new element detected, not the form. scanMessages checks for a form and registers the message under the form, but it only walks down the DOM, so if the new element is within the form no form is found and the message is not registered.
In my case I can work round this by adding form attributes to the message spans before adding them to the DOM, but that probably isn't always going to be possible.
Probably need to walk up the DOM until finding a form if the root isn't a form and doesn't contain any forms. Only if that doesn't find a form (in which case the new element detected wasn't relevant) should the function return without searching for message spans to register.
The text was updated successfully, but these errors were encountered: