Chronoforms 8.0.9 - regex

Block specific characters in a ChronoForms textarea.

Overview

The issue is that a textarea field needs to prevent submissions containing certain strings like href, www, or http.
Use the PHP validation function in the Valid Function behavior to check the field value and return a custom error message if a disallowed string is found, which will stop the form from being processed.

Answered
ChronoForms v8
rb rbock 03 Aug, 2023
Hello...

how can i stop the following characters for textarea

href
www
https
http
.xyz
Max_admin Max_admin 03 Aug, 2023
Answer
1 Likes
use PHP validation for this (Valid Function) behavior:
if(str_contains($value, "href")){
return "your message should not contain href";
}
return true;

this will not stop the form to be submitted by the browser but users will not be able to send the form, it will show an error message
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.