Skip to content

Update reference.md #25

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 2 commits into from
Closed

Conversation

sparky672
Copy link
Contributor

Clarified this section to reflect many questions on StackOverflow. It seems to be a common mistake to leave out or duplicate the name attribute. It's also a misconception that an id is needed at all for this plugin to work. Nowhere in the documentation is it explicitly stated that name attribute must be unique... only implied. My proposed changes spells these items out more clearly.

The most important markup requirements are moved to the very top of this section in a paragraph preceded by the word "Mandated". Removed the triple single quotes from the word "required" as this just seems like we're talking about the required rule.

And to eliminate any confusion, anything that has no effect on the operation of the plugin is confined to a paragraph preceded by the word "Optionally".

Clarified this section to reflect many questions on StackOverflow.   It's a common mistake to leave out or duplicate the `name` attribute.  It's also a common misconception that an `id` is needed at all for this plugin to work.  Nowhere in the documentation is it explicitly stated that `name` attribute must be unique... only implied.  My proposed changes spells these items out more clearly.

The most important markup requirements are moved to the very top of this section in a paragraph preceded by the word "Mandated".  Removed the triple single quotes from the word "required" as this just seems like we're talking about the `required` rule.

And to eliminate any confusion, anything that has no effect on the operation of the plugin is confined to a paragraph preceded by the word "Optionally".
@@ -10,14 +10,15 @@ To achieve this, it is important that the plugin is actually deployed on website
The plugin can never replace serverside validation and doesn't intend to do so. Having both in place gives you the necessary security for your application, as well as improved usability.

# Markup recommendations
Each input has a label associated with it: The for-attribute of the label refers to the id-attribute of the input.
Mandated: A 'name' attribute is required for all input elements needing validation, and the plugin will not work without this. A 'name' attribute must also be unique to the form, as this is how the plugin keeps track of all input elements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox/radios can have equal names

Copy link
Contributor Author

@sparky672 sparky672 Jul 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox/radios can have equal names

This is true. However, a group of these elements are treated like a single data input point. Give two different groups of radio or checkbox elements the same name and you'll have an issue where they're all lumped together incorrectly:

http://jsfiddle.net/smva87bx/

I'll make some clarifications to note this exception.

@staabm staabm closed this in 4127687 Jul 25, 2016
@staabm
Copy link
Member

staabm commented Jul 25, 2016

manually merged, thx

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