Hello,
I'm trying to set some javascript form validation but I can't seem to figure it out. Any help is most appreciated.
Here is what I tried but it doesn't produce any error messages: (I'm mainly interested in getting a regex validator working, the required field validator is already set)
$fields = new FieldList (
TextField::create('MyText').setAttribute('data-validation-regex', '[0-9]+'),
...
When I try to use '->' instead of '.' I get the following error:
PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR)