Hi,
i have managed to use a validation with a number through the regex like /^(27)/ for number 27.
Now i am looking to find how i validate a text-input with a word, i tried /^(dog)/ for the word dog but that does not work.
I can find lots of regex-tests but does not seem to fit my wish, do i need javascript here?
and when how do i enter that in CMSMS? Does anyone have an example please?
Kind regards,
Jan
Formbuilder validate a textfield
Re: Formbuilder validate a textfield
It's a perl style regex according to the docs, so for dog (case insensitive) you'd just do:
See https://perldoc.perl.org/perlre
Code: Select all
/dog/i
Not getting the answer you need? CMSMS support options
Re: Formbuilder validate a textfield
Additionally I think you need to add a ^ and $ to check for the whole string, not a substring. E.g. dog vs dogma vs bulldog
Code: Select all
/^dog$/i
Re: Formbuilder validate a textfield [SOLVED]
Thanks a lot!
i have build this into the form and it works.
Do not laugh, i forgot to mark that the regex must be used . .
Since there is a real explosion of spamming through contact-forms i need to build validation in those forms.
Regards,
Jan
i have build this into the form and it works.
Do not laugh, i forgot to mark that the regex must be used . .
Since there is a real explosion of spamming through contact-forms i need to build validation in those forms.
Regards,
Jan