![]() |
| ||
| Trim spaces 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 bIs 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,"" |
| ||
| Re: Trim spaces |
| ||
| Re: Trim spaces Do it manually. Just loop through the input and remove that character which is equal to <space> from the string and then take first 3 character for the search input string. |
| All times are GMT -4. The time now is 4:10 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC