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

validate empty string #42

Open
MichaelIT opened this issue Apr 26, 2016 · 3 comments
Open

validate empty string #42

MichaelIT opened this issue Apr 26, 2016 · 3 comments

Comments

@MichaelIT
Copy link

MichaelIT commented Apr 26, 2016

hi,I need to validate a value not a empty string,but it is no required,can somebody tell me how to do that.

{ meeting_register_begin:{ isRequired: false, isDate:true, not:/^$/ } }

I try to use not , but it does not work.I want to do that because it will cause error in database query when this datetime value is empty string.

@gchauvet
Copy link
Collaborator

did you try "notRegex" ?

{ meeting_register_begin:{ isRequired: false, isDate:true, notRegex:/^$/ } }

@MichaelIT
Copy link
Author

MichaelIT commented Apr 27, 2016

@gchauvet tks u reply

i try to change my validation from

{ meeting_register_begin:{ isRequired: false, isDate:true, not:/^$/ } }

to

meeting_register_begin:{ isRequired: false, isDate:true, notRegex:/^$/ }

but i still get meeting_register_begin in my logic part of my code.And it was still a empty string.

@gchauvet
Copy link
Collaborator

Sorry for my lack of time, I take a look ASAP

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