-
- 659 Posts
Hi all,
I’m very confused about custom validators in formit and need some guidance...
I have, in my form, 2 fields which are for phone numbers (let say ’phone1’ and ’phone2’).
I’d like to have a custom validation for these fields with the following behaviour :
If the value ( "$scriptProperties[’value’]" ?) does not match the regex, I would like to display an error message in the [[+fi.error.phone1]] (if phone1 is false) or in the [[+fi.error.phone2]] (if phone2 is false).
By the way I would like re-use this "validator" (let say ’phonenumber’) in other forms by calling the validator when I need it, like it can be done with built-in validators...
I’ve tried lot of things following the doc but cannot achieve what I want. (the best result I obtain is to display an error messages under both fields phone1 and phone2, if one of them is false)...
Thanks for your help...
EDIT & SOLVED :
It works ! the culprit were a)my regex, b)the cache
-
- 116 Posts
Could you paste your code you used for the custom error message and the placeholder your using? I am stuck on something similar.
-
- 659 Posts
I sent it to you via PM....
Some of the validators can be replaced now with ’FormItIsChecked’ and ’FormItIsSelected’ I guess... I’m a bit busy these days but feel free to ask if you need explanations
Cheers