Validating a form control to not allow Special characters

  • 28 September 2023
  • 2 replies

Badge +2

I have what I would expect to be a simple validation of a form control not to have any special characters.  It seems like a Regular Expression should handle this.


I read this prior post which appeared to give me a simple answer of w+.  I tried that and it didnt allow even valid alpha numberic characters. 

I also tried ^[a-zA-Z0-9] which I found by google searching.  This allowed special characters still.  Any ideas?


Best answer by bamaeric 28 September 2023, 16:31

View original

2 replies

Userlevel 5
Badge +12

Check out these posts to see if they are what you are looking for.

Strip Special Characters from entered value | Community (

Excluding characters in regular expression | Community (

Validating a Form Control with Regular Expression | Community (

Badge +2

Thanks you Bamaeric.  I only found one of those when I searched it it was the last one which didnt work.  THe second one was exactly what I wanted.