Skip to content

Optional Attribute #12

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

Merged
merged 1 commit into from
May 11, 2012
Merged

Optional Attribute #12

merged 1 commit into from
May 11, 2012

Conversation

robamaton
Copy link
Contributor

When you need to say "this is an optional field but if there's something there I need it validated."

I'm not sure if this fits in perfectly, but it looks like this:

Maybe there could be a setting which says "assume required" (default) or "assume optional" which could then be overridden by a data-required="true/false".

What do you think?

@victorjonsson
Copy link
Owner

Nice! this seems like an important feature! But I will move the code to jQueryFormUtils.validateInput, the only function that is supposed to know how to validate a certain input.

victorjonsson added a commit that referenced this pull request May 11, 2012
@victorjonsson victorjonsson merged commit 08dc139 into victorjonsson:master May 11, 2012
@robamaton
Copy link
Contributor Author

That makes sense. I'm glad it was useful!

@victorjonsson
Copy link
Owner

The name of the attribute is now renamed. We try to stay with the namespace data-validation, the new name is therefor data-validation-optional. One could argue that this is a bit long name to write but staying to a single namespace is favored in this case...

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