Solved

Help with javascript expression to prevent input values

Posted on 2012-03-29
2
252 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SharePoint and CAML query help 4 20
Two decimal 5 39
Move inline javascript functions to external .js file in asp.net 12 50
Put javascript to get dropdown value 3 32
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

731 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