Skip to content

validation based on selected operator #1141

Answered by ukrbublik
schiller-manuel asked this question in Q&A
Discussion options

You must be logged in to vote

You can use this in field config:

fieldSettings: {
        validateValue: (val, fieldSettings, operator) => {
             if (operator == 'regex') {
                 try { new RegExp(val) } catch (e) { return false; }
             }
             return true;
        }
}

But you need to add this to every field that can have 'regex' operator

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@schiller-manuel
Comment options

Answer selected by schiller-manuel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants