Printaccel Posted January 29, 2009 Share Posted January 29, 2009 Hi, I thought I saw this once, but of course now that I need it, I can't find it anywhere. I'm sure its probably very simple, but I am a total noob to JavaScript. I need to be able to strip a field of anything non-alphanumeric, and convert what's left to lower case. I know there is a rule for the lowercase, and if I am correct, I think I can exchange Rule("Rulename") Link to comment Share on other sites More sharing options...
Dan Korn Posted January 30, 2009 Share Posted January 30, 2009 return Field("MyFieldName").replace(/\W/gi, "").toLowerCase(); https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replace https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Regular_Expressions https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp Link to comment Share on other sites More sharing options...
Printaccel Posted January 30, 2009 Author Share Posted January 30, 2009 Thanks Dan. That one is much simpler than the scripts I was finding when I googled it. They were about 30 lines long and I had no idea what to replace for field. I very much appreciate it! Tina (Oh and thanks for the links too) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.