Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
devgnx wants to merge1 commit intojquery-validation:masterfromdevgnx:patch-1

Conversation

devgnx
Copy link

@devgnxdevgnx commentedMar 8, 2017
edited by Arkni
Loading

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

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
@Arkni
Copy link
Member

Found that the problem was my code, it has a form inside another form. But that's not clear from the message above.

What do you think about throwing an error that describe the issue. Something like this:

It looks like you're calling a plugin method on an element outside the formthat was used to initialize the plugin.Please make sure to call the plugin methods on elements that are part ofthe initial form.

@staabm
Copy link
Member

@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.

@Arkni
Copy link
Member

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.

devgnx reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@ArkniArkni

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@devgnx@Arkni@staabm

[8]ページ先頭

©2009-2025 Movatter.jp