RSS Forums RSS
Please support our HTML and CSS advertiser: Lunarpages Web Hosting

Validate textboxes

Join Date: Dec 2004
Posts: 1,592
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 8
Solved Threads: 35
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Validate textboxes

  #4  
Sep 12th, 2005
Sorry. Include the "\s" special character within your character class. You'll need to escape the blackslash WITH a backslash. For example this works:

function testRegEx(x)
{

  var regex = new RegExp("[^A-Za-z0-9\\s]");

  if (x.value.search(regex) != -1)
  {
    alert("Invalid Entry.");
  }
}
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:21 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC