|
-
Oct 23rd, 2001, 02:58 AM
#1
Thread Starter
Member
like [a-z]
hi there,i need to write a function that alert me if the textfield value is not between [a-z] and [1-9] and other charchters like underscor "_",
i know there is a "LIKE" function in Vb,but when it comes to Jscript,i'm just a beginner,thank you for your time.
-
Oct 23rd, 2001, 08:54 AM
#2
Frenzied Member
Well, I don't do anything with JScript, so I wouldn't know...
But in JavaScript...
Code:
if (testString.search(/\W/) != -1) {
// String is good, contains only a-zA-Z0-9_
}
else {
// String is bad, warn user
}
Ofcourse, TIAMTOW, and I haven't even tested this code.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Oct 28th, 2001, 10:21 PM
#3
PowerPoster
I found a sweet script to do this somewhere. I think she's on my home machine though, so I'll send it later if I remember.
Someone post here to remind me, and I'll see the reminder when I check my email at home later...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|