Link to home
Start Free TrialLog in
Avatar of Dewi
Dewi

asked on

isalpha(),isalphanumeric(),isnumeric()

I need all above functions in js (using regexp)
I don't want to create own function using a loop
Thanks
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

isInteger = /^\d+$/;


if (isInteger.test(form.myField.value))...
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dewi
Dewi

ASKER

Hi mplungjan,

Thx for your prompt reply,
but what about isAlpha() and isAlphaNumeric() ?
Yeah - I didn't have them off the top of my head.. I will look
Avatar of Dewi

ASKER

Hi mplungjan,

Thx a lot, ur links was very useful
Avatar of Dewi

ASKER

well done !
Avatar of Dewi

ASKER

well done !
\w was including the underscore so I think you want

isAlpha = /^\[a-zA-Z]+$/;
isAlphaNum=/^\[a-z0-0A-Z]+$/;
Avatar of Dewi

ASKER

btw, i still can't find isAlpha()
can you help me on this ? thx
Avatar of Dewi

ASKER

uppsss..  just ignored my last comment
thanks ...
and change "+" to "*" if you allow the fields to be empty
Also make SURE it has
value=""
in the tag to make sure it is a string even when it is empty.
ANd I had a typo: isAlphaNum=/^\[a-z0-0A-Z]+$/;
is
isAlphaNum=/^\[a-z0-9A-Z]+$/;