barkster Posted July 28, 2007 Share Posted July 28, 2007 I'm trying to do a regex to allow only alphanumeric and the underscore but I can't get it to work. I've tested on a few reg testers and it worked there but I can't get it to work on my page. javascript var rah = new RegExp(/([^A-Za-z0-9_])/); if (!rah.test(f.tbgalleryname.value)) { alert("Your folder name has illegal characters.\nCan only contain alphanumeric characters (a-z 0-9 _)"); return false; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.