Skip to content

Change generic form selector from class into id #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

Closed
wants to merge 1 commit into from

Conversation

sparky672
Copy link
Contributor

@sparky672 sparky672 commented May 6, 2016

Some examples on this page are using $(".selector").validate() and others are using $("#myform").validate().

Using $(".selector") implies that .validate() can be directly attached to a class selector where, if this is actually done without wrapping it within an .each(), it would only be attached to the first instance of this class.

The $(".selector") should be changed into $("#myform") on the entire page for consistency with the other examples and less confusion. I think $("#myform") is more appropriate since the .validate() method should only be attached to a selector that represents a single form element.

Some examples on this page are using `$(".selector").validate()` and others are using `$("#myform").validate()`.

Using `$(".selector")` implies that `.validate()` can be directly attached to a class selector where, if this is done without using an `.each()`, it would only be attached to the first instance of this class.

The `$(".selector")` should be changed into `$("#myform")` on the entire page for better consistency and less confusion.  I think `$("#myform")` is more appropriate since the `.validate()` method should only be attached to a selector that represents a single `form` element.
@staabm staabm closed this in e413808 Jul 12, 2016
@staabm
Copy link
Member

staabm commented Jul 12, 2016

thanks.

@staabm
Copy link
Member

staabm commented Jul 12, 2016

merged via 49ce0cc

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.

2 participants