javascript_howto thread: SV: Re: SV: Re: SV: Re: SV: checking for nonalpha numeric characters
Thanks, I already know them (thankfully, I can say, after previous
projects).
Good luck!
/Robert
-----Ursprungligt meddelande-----
Fr=E5n: Noreen M Masterson [mailto:noreen_masterson@s...]
Skickat: den 13 januari 2003 15:50
Till: JavaScript HowTo
=C4mne: [javascript_howto] Re: SV: Re: SV: Re: SV: checking for nonalpha
numeric characters
thanx so much for your help
in case u want to add to ur knowledge
i found some other reg expr
Certain predefined character sets:
\d
The digits [0-9]
\w
A word character [A-Za-z_0-9]
\s
White space [ \t\n\r]
\D
A non-digit
\W
A non-word
\S
Non-whitespace
cheers
noreen
> Not sure about the alpha part, but here comes some RegExp links:
http://www.webreference.com/js/column5/
http://msdn.microsoft.com/library/default.asp?url=3D3D/library/en-us/jscr
i
p=3D
t
7/html/jsreconintroductiontoregularexpressions.asp
/Robert
-----Ursprungligt meddelande-----
Fr=3DE5n: Noreen M Masterson
[mailto:noreen_masterson@s...]=3D20
Skickat: den 13 januari 2003 15:32
Till: JavaScript HowTo
=3DC4mne: [javascript_howto] Re: SV: Re: SV: checking for nonalpha
numeric
characters
Excellent! thanx a million - where can i find these regular expression i
would like the check to check for non alpha numerics
so it would be something like
> function keyCheck(e){
var keyChar =3D3D String.fromCharCode(e.which);
if((keyChar.search(/\D/) !=3D3D -1) && (keyChar.search(alpha reg
expr)! =3D3D -1){
alert(One of the characters isn't alpha numeric");
}
}
thanx a million
Noreen
> The 3D is just a mess-up in WROX mailing lists.
Just remove all instances of 3D.
The RegExp is looking for anything that isn't a digit.
If it finds anything the alert pops up.
/Robert
-----Ursprungligt meddelande-----
Fr=3D3DE5n: Noreen M Masterson =3D
[mailto:noreen_masterson@s...]=3D3D20
Skickat: den 13 januari 2003 15:24
Till: JavaScript HowTo
=3D3DC4mne: [javascript_howto] Re: SV: checking for nonalpha numeric
characters
hi robert
confused by 3D string? - is this just a var instance or?
also the reg expr u search for /\D what does this equate to?
thanx
noreen
> function keyCheck(e){
var keyChar =3D3D3D3D String.fromCharCode(e.which);
if(keyChar.search(/\D/) !=3D3D3D3D -1){
alert(One of the characters isn't a number");
}
}
/Robert
-----Ursprungligt meddelande-----
Fr=3D3D3DE5n: Noreen M Masterson =3D3D
[mailto:noreen_masterson@s...]=3D3D3D20
Skickat: den 13 januari 2003 15:09
Till: JavaScript HowTo
=3D3D3DC4mne: [javascript_howto] checking for nonalpha numeric
characters
hi
i am trying to check each character entered and make sure it is only
an=3D3D3D20 alpha-numeric char
function keyCheck(e){
var keyChar =3D3D3D3D String.fromCharCode(e.which);
//here is where u would have to check the key then
}
document.captureEvents(Event.KEYPRESS);
document.onkeypress =3D3D3D3D keyCheck;
i know in Java u can use char.isLetterorDigit(myString.charAt(index))
but how can this be done in javascript??
thanx
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D3D3D20
to
unsubscribe send a blank email to
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D3D20 to
unsubscribe send a blank email to
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D20 to
unsubscribe send a blank email to