•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 425,893 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,974 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 349 | Replies: 2
![]() |
•
•
Join Date: Nov 2007
Posts: 25
Reputation:
Rep Power: 1
Solved Threads: 0
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: 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,""
For example I dont want this to go by where it has spaces in beginning and space between 2 characters: 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,""
•
•
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 770
Reputation:
Rep Power: 2
Solved Threads: 63
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- C/C++ Code Syntax Highlighting (DaniWeb Community Feedback)
- Please help with assignment (C++)
- Using isspace with white spaces (C++)
- Trim Strings (JavaScript / DHTML / AJAX)
- trim trailing spaces (C++)
- Whats wrong with this class??? (C++)
- This ought to be simple - extra spaces (PHP)
- I don't know how to start (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Onclick to pass a variable to a PHP script
- Next Thread: help please ie based javascript problem


Linear Mode