Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Fixed "Cannot read property 'settings'" error#1970
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
First of all, sorry for my horrible english.I've been facing the problem on a project and searched for work-arounds on the web, but none of them lead to a right solution.When I try to post a specific form the plugin is returning: "Cannot read property 'settings' of undefined";Found that the problem was my code, it has a form inside another form. But that's not clear from the message above.Instead of returning the error, I made a change to check if the property exists on the current form.'Couse after all, this plug in is not to validate my HTML, it's made to validate my inputs.Thanks for the awesome plugin.Some links:jquery-validation#1076jquery-validation#401jquery-validation#917jquery-validation#86https://elnibs.wordpress.com/2013/10/22/jquery-validation-issue-cannot-read-property-settings-of-undefined/https://forums.asp.net/t/1853275.aspx?+Cannot+read+property+settings+of+undefined+error+when+adding+a+rule+to+validator
What do you think about throwing an error that describe the issue. Something like this:
|
@Arkni I like the error message.. At best we also name the form by id and/or name in the error messages so it gets obvious which forms are part of the game. |
Finally circling back to this. After reinvestigating the issue, I found that what I suggested in my previous comment apply to the case when the developer called a plugin method on an element of another form, which is totally different from the issue that the OP was trying to fix. I did some test and created a proper fix with tests. I will close this PR in favor of#2147. @gnxdev thanks a lot for opening this PR and sorry for not merging it. |
Uh oh!
There was an error while loading.Please reload this page.
First of all, sorry for my horrible english.
I've been facing the problem on a project and searched for work-arounds on the web, but none of them lead to a right solution.
When I try to post a specific form the plugin is returning: "Cannot read property 'settings' of undefined";
Found that the problem was my code, it has a form inside another form. But that's not clear from the message above.
Instead of returning the error, I made a change to check if the property exists on the current form.
'Couse after all, this plug in is not to validate my HTML, it's made to validate my inputs.
Thanks for the awesome plugin.
Some links:
#1076
#401
#917
#86
https://elnibs.wordpress.com/2013/10/22/jquery-validation-issue-cannot-read-property-settings-of-undefined/
https://forums.asp.net/t/1853275.aspx?+Cannot+read+property+settings+of+undefined+error+when+adding+a+rule+to+validator