Skip to content
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

[Feature Request] NotRequired rule for date_format and email #10

Closed
RicardoEmpre opened this issue Sep 1, 2016 · 3 comments
Closed

Comments

@RicardoEmpre
Copy link

I don't know if I'm not seeing the feature or if it's not present:
for example, if I have an input with data-rules="numeric" and it is empty, it will pass the validation
BUT, if I have something like data-rules="date_format:DD/MM/YYYY" or data-rules="email", and the input is empty, it will NOT pass the validation as if the field is required.

@logaretm
Copy link
Owner

logaretm commented Sep 1, 2016

You are right, I was planning to fix this sometime ago but few critical things came up. this issue will be fixed in the next couple of days. required is now kinda misleading.

The suggested behavior is: unless the field is required, empty values will pass the validation.

@RicardoEmpre
Copy link
Author

thanks! great work with this!

@logaretm
Copy link
Owner

logaretm commented Sep 2, 2016

@RicardoEmpre OK it is implemented now in the last commit, I will tag a release tonight or first thing in the morning.

From now on, all fields pass will validation if they have "empty" values, unless they have the required validation rule. the values that are considered empty are: undefined, null and ''

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

No branches or pull requests

2 participants