Hi.
Is there a way to use field validation and check for special characters in the text field?
For example, if users type space or underscore in the text field the field validation would fail.
Thanks!
BR.
Hivzo.
Hi.
Is there a way to use field validation and check for special characters in the text field?
For example, if users type space or underscore in the text field the field validation would fail.
Thanks!
BR.
Hivzo.
Hi @HCEH, there unfortunately isnât a way yet to check for special characters in the text field validation. If we were to add âDoes not containâ rules to the validation options, do you think that would allow you to achieve this?
Thanks @shep
âContainsâ and âDoes not containâ relates to an array or object list and not to the specific characters in the text field.
I would suggest having an option to select Expression in validation rules. That would open up for a number of possibilities to validate the field including the check for special characters.
@HCEH Adding the ability to create expressions in the validation rules is definitely clear here. However, Iâm wondering if we were to add a âDoes not containâ rule and you were to specify the special characters, would this work for you?
For example: âDoes not containâ â_â and âDoes not containâ â[space]â would check if these characters would appear in the user input.
Would this happen to work for you?
Hey @shep
Please correct me if I am wrong but the current logic is based on the object lists or arrays and not exactly on the string. So I searching for the single characters with current logic implemented in the validation would not work. Am I being wrong here?
The current âContainsâ validation logic works as such â it searches the string to validate that it contains a particular character or value defined in the rule.
So, for your case, you could write the validation rule on a text input field:
Contains *
Contains _
This would check to make sure that both a * and _ are in the string.
Do you think a Does not contain
rule that works the same way satisfy your original request? Meaning, it would check to see if the input contains a special character defined in the rule and throw an error if it does.
@shep
âDoes not containâ would definitely satisfy my need to check for those unacceptable characters in the string.
Thank you very much!