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

combine isEmail and allowEmpty #25

Open
ir-fuel opened this issue Dec 13, 2015 · 1 comment
Open

combine isEmail and allowEmpty #25

ir-fuel opened this issue Dec 13, 2015 · 1 comment

Comments

@ir-fuel
Copy link

ir-fuel commented Dec 13, 2015

It seems that I cannot use allowEmpty in the validate attribute.

What I would like to do is validate a field to be either a valid email address or empty. I don't seem to be able to do this? Am I correct or am I missing a simple way of doing this?

            <ValidatedInput
              id="profile-companyMail"
              name="companyMail"
              type="email"
              placeholder="Email"
              validate="isEmail"
              errorHelp="Incorrect Email"
            />

I would like to be able to put something like validate="allowEmpty,isEmail"

Thanks for helping me out!

@brewsoftware
Copy link
Contributor

Please see pull request #53 .
The syntax will need to change as the assumption is that everything is an "and" condition at the moment. Extending the framework to handle "isEmpty" is fairly straight forward but the conditional processing parsing is a little harder and needs some more work.

Comments and suggestions are welcome on PR #53

Cheers,
Jason

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