Solved

Help with javascript expression to prevent input values

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

809 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