Skip to content

[Form Validation] Add "not" option to rule #2638

Closed
@fpayer

Description

Copied from the example on the docs: http://semantic-ui.com/behaviors/form.html#/examples

There is a "contains" rule which checks if a substring exists, and a "not" rule which checks if the form value equals a preset value; however, there is no "notContains" rule to check that a substring does not exist.

See the below JSFiddle:
https://jsfiddle.net/rduvhn8u/80/

If you enter "mean", the validation will error, but if you enter, "mean fluffy dog", the validation will pass. There should be a way to reverse the expected value of a rule so that the "contains" rule could check that a string does not exist. I would suggest adding a "!" in front of the rule's type.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions