This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes pattern search in java script. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "pattern search in java script." Watch "pattern search in java script." New topic
Author

pattern search in java script.

Prem Shankar
Greenhorn

Joined: Jul 28, 2003
Posts: 21
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

Joined: Jun 06, 2002
Posts: 1056
var alphaPattern = /\d/;
that's not even going to compile.


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Prem Shankar
Greenhorn

Joined: Jul 28, 2003
Posts: 21
but its working fine..and my app uses tht fn to check digits in names.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: pattern search in java script.
 
Similar Threads
Guestion is Validate the text?
Set to null...
Regular Expression Help
Making a google like suggest out of html controls.
AOP in javascript