Hey guys,
I am trying to to some checks on regex for a form validation process. let s take the following scenario.
a form where the agent enters an email address, click on a button to create a contact with that email address. If the email address is wrong, I want to disable the button. This is not possible with the "validation" property on an input component (cannot do anything with the validation except displaying the input component in red).
My idea was to use math.filter to do the regex check within a dynamic variable but all my test failed. So I wanted to just validate wether or not "filter" is an enabled function. Here is what I tried :
- Create a string dynamic variable
- took the basic example from mathjs official website : ```
math.filter(["23", "foo", "100", "55", "bar"], /[0-9]+/) --> should return ["23", "100", "55"]. - I adapted it in the dynamic var. Here are my different tries :
- string(filter(["23", "foo", "100", "55", "bar"], /[0-9]+/))
- filter(["23", "foo", "100", "55", "bar"], /[0-9]+/)
- filter(["yes"],/yes/)
- string(filter(["yes"],/yes/))
Also tried with a number dynamic variable :
- count(filter(["yes"],/yes/))
Nothing works, the var is always empty.
Any idea on this? Thanks a lot