Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with javascript expression to prevent input values

Posted on 2012-03-29
2
Medium Priority
?
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 800 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

604 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