Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Help with javascript expression to prevent input values

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 as the validation only works if someone enters

1 Solution
re =/@gmail|@hotmail|@otherdomains/i;
MimUKAuthor Commented:
As simple as that... Doh
Many thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now