Hi There, I am having trouble with validation on a text field on a form. I want to prevent the entry of special characters, particularly &, %, $, #. These characters ruin a URL construction that gets sent out. When those characters are included, the url won't work. I tried \w* and it works to an extent. It certainly prevents the characters, but unfortunately, I need people to be able to enter multiple words. It is a single line field where they enter their company name. I know i am jsut missing something in the expression validation, but i am unable to build a solution. Thanks!
Question
Question
Answer
SELECTED ANSWER
replied on February 12, 2020
Hi John-Paul
Rather the excluding characters, you may find it easier to state what characters are valid.
Something like this may work better. This will allow any number or letters, numbers or spaces in the field. And other character outside of this constraint will show invalid input
[a-zA-Z0-9\s]+
0
0
Replies
You are not allowed to reply in this post.
You are not allowed to follow up in this post.