Solved

Help with javascript expression to prevent input values

Posted on 2012-03-29
2
246 Views
Last Modified: 2012-03-29
I have a validation script in my application to prevent the input of certain email addresses.
It works if the domain in entered in the case thats expressed, however I need to make it non-case sensitive

var strRuleMessage = 'Forbidden Email Address Extension'; 
var strFieldData = Values("field_emailaddress"); 
re =/@gmail|@hotmail|@otherdomains/; 
r = strFieldData.match(re); 
if (r) 
{ 
Valid = false; 
ErrorStr = strRuleMessage; 
}

Open in new window


Its line 3 that needs the ability to not allow someone to enter me@Hotmail.com as the validation only works if someone enters me@hotmail.com

Cheers
0
Comment
Question by:MimUK
2 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 200 total points
ID: 37780719
re =/@gmail|@hotmail|@otherdomains/i;
0
 

Author Closing Comment

by:MimUK
ID: 37780749
As simple as that... Doh
Many thanks.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now