This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pattern search in java script.

 
Prem Shankar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
function CheckAlphabetic(formElement)
{
value = formElement.value;
var alphaPattern = /\d/;
if (!alphaPattern.test(value))
{
return(true);
}
else
{
return false;
}
}
im using this function to check if a name has 'digits' in it. "alphapattern.test(value)" can be replaced by ".match(value)" also. Is there someothr method to do tht?? Also other than "match,test" wht are all the methods can var(alphapattern) use?
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
var alphaPattern = /\d/;
that's not even going to compile.
 
Prem Shankar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but its working fine..and my app uses tht fn to check digits in names.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic