-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Setting: Adding ability to override the default element tag list. #2063
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
Conversation
This override allows elements implementing an input interface to be validated
With custom element you mean actually a webcomponent? Really like what I see, thx! |
@@ -616,7 +617,7 @@ $.extend( $.validator, { | |||
|
|||
// Select all valid inputs inside the form (no submit or reset buttons) | |||
return $( this.currentForm ) | |||
.find( "input, select, textarea, [contenteditable]" ) | |||
.find( validator.settings.inputSelector ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validator -> this
@@ -265,6 +265,7 @@ $.extend( $.validator, { | |||
errorLabelContainer: $( [] ), | |||
onsubmit: true, | |||
ignore: ":hidden", | |||
inputSelector: "input, select, textarea, [contenteditable]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other settings dont use the suffix Selector
we shouldnt use it either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure yet what a good name should be for this setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about targets
?
It aligns well with the internal method validationTargetFor(...)
.
Over all, it looks good to me. One small thing that come to my mind while reading the description & the patch. How can the plugin attach events ( Lines 409 to 418 in c62e0d9
What do you propose to fix that? |
Any updates regarding this PR? Thanks! |
This issue/proposal has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. |
This override allows elements implementing an input interface to be validated
Description
We have been using jQuery validation for several years and it has been very useful for our organization. Unfortunately, one area that it falls short is where it doesn't support custom elements that behave like native inputs. There is no way (without overriding methods) that we know of to validate any input type other than those that are hard coded in the
elements()
prototype method. This Pull Request attempts to provide a simple method for customizing what tags theelement()
function looks for.