I want to make sure at least 3 characters are entered into a search field.
For example I dont want this to go by where it has spaces in beginning and space between 2 characters:
a b
Is there a regular expression or someway to trim the spaces between the characters so I dont let less than 2 characters get submitted?
Here is one reg expression I tried but it let spaces between characters get entered so less than 3 characters were submitted.
/^\s+|\s+$/g,""