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

  #2  
Sep 10th, 2005
You could use an expression modifier, to add the /s to your character array. I haven't tested it, and it's late, but try:

function PasteAlphaNumeric(objEvent)
{
  var strPasteData = window.clipboardData.getData("Text");
  var objInput = objEvent.srcElement;
  if (strPasteData.search("[^A-Za-z0-9]+/s")!=-1)
  {
    alert("The character you attempted to paste is not allowed for this field.");
    objInput.focus();
    return false;
  }
}
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8: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