User-defined characters for the validation of EditBoxes break the validation
Posted: Thu Jun 05, 2025 9:24 pm
I am using the old version 15.4.5, but it is possible that this “bug” exists also in the current version.
It took me almost 8 hours to find the solution to this problem and I have aged at least 5 years in the process.
The problem is that my form fields were not validated, although everything looked fine on the surface.
Given is a form with an EditBox, which is declared in the “Validate” tab with the datatype Text (in my case it was an extensive form with many fields and checkboxes, which did not make the search any easier).
In my case, Validation mode is set to “Default”, Data required is activated and Data lenght is configured with Min. = 1 and Max. = 999.
Now at the bottom of the “Validate” tab you have the option of selecting [x] Letters, [x] Digits, [x] Whitespace and [x] Others.
Everything works fine until you (unknowingly) type the probably only wrong character into the “[x] Others” input field. I entered the following characters there: ( ) / \
And apparently the \ (backslash) character broke the entire form validation.
I then found the problem manually in the PHP file in which the form is located. There is the function “submit[formname]”().
There the validation is apparently carried out with a RegEX that starts as follows...
{regexp=/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6}
I no longer have the PHP file with the broken validation, but I know that the characters ()/\ were embedded directly in the RegEX. Since the backslash is obviously an escape character, I think it broke the regex expression. I'm not an expert on this, but I can say that the validation worked again after I removed the string ()/\ from the [x] Others input field.
It's a shame that something like this isn't caught. I hope I was able to save other lives with this article, or at least save them from “going crazy while troubleshooting” - as it happened to me.
Greetings
Markus
It took me almost 8 hours to find the solution to this problem and I have aged at least 5 years in the process.
The problem is that my form fields were not validated, although everything looked fine on the surface.
Given is a form with an EditBox, which is declared in the “Validate” tab with the datatype Text (in my case it was an extensive form with many fields and checkboxes, which did not make the search any easier).
In my case, Validation mode is set to “Default”, Data required is activated and Data lenght is configured with Min. = 1 and Max. = 999.
Now at the bottom of the “Validate” tab you have the option of selecting [x] Letters, [x] Digits, [x] Whitespace and [x] Others.
Everything works fine until you (unknowingly) type the probably only wrong character into the “[x] Others” input field. I entered the following characters there: ( ) / \
And apparently the \ (backslash) character broke the entire form validation.
I then found the problem manually in the PHP file in which the form is located. There is the function “submit[formname]”().
There the validation is apparently carried out with a RegEX that starts as follows...
{regexp=/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6}
I no longer have the PHP file with the broken validation, but I know that the characters ()/\ were embedded directly in the RegEX. Since the backslash is obviously an escape character, I think it broke the regex expression. I'm not an expert on this, but I can say that the validation worked again after I removed the string ()/\ from the [x] Others input field.
It's a shame that something like this isn't caught. I hope I was able to save other lives with this article, or at least save them from “going crazy while troubleshooting” - as it happened to me.
Greetings
Markus