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

Form validation does not have a rule to validate if field value differs from a string #3462

Closed
crustamet opened this issue Aug 7, 2020 · 3 comments · Fixed by #3481
Closed

Comments

@crustamet
Copy link
Contributor

Hello i am trying to validate an input that must have another string besides what i set

So for example
i have an input type text with value of "Test"

I want to validate this field that must be changed so it cannot have string Test inside the field

I have no rule for this
Something like
is_not_string[test]

@michalsn
Copy link
Member

michalsn commented Aug 8, 2020

You can probably use regex_match rule for this. Something like: regex_match[^(?!.*?Test).*] maybe?

@crustamet
Copy link
Contributor Author

I also can verify the post and give a custom message saying the string cannot be "Test"

With regex i get error "The Test input has not a valid format". (for this to correct i have to put a custom validation error message)
While a is_not_string[test] can give an error message like "The Test field cannot be Test".

I would really like this is_not_string in the validation form.

@lonnieezell
Copy link
Member

We have an in_list rule already, it would make sense to have the inverse of that, not_in_list.

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 a pull request may close this issue.

3 participants