File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes blocking certain email addresses Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "blocking certain email addresses" Watch "blocking certain email addresses" New topic
Author

blocking certain email addresses

Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
I have this script with me that blocks any others address except the one that belong to 'xyz.zom.com' domain ... now i want to block certain email address belonging to this domain .. like for eg. i want to block an entry if it's "aa@xyz.zom.com","bb@xyz.zom.com " and so on...!! what addition do i have to make to the following script...?
<script LANGUAGE="JavaScript">
function TestEmail(StrT)
{
var StrRE = /^[\w.]{1,}@xyz.zom.com$/;
var xyz= "@xyz.zom.com";
if(StrT.match(StrRE))
{
return StrT;
}
else
{
alert('Invalid email address entered. The format of Email ID is emailid@xyz.zom.com);
return xyz;
}
}
</script>

???
Thanks...
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
No Replies...? :roll:
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I think it is like
var StrRE = /^[\w.]{1,}@(abc|cde|asd|cdf).zom.com$/
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
thanxssss a lot .... it worked..!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: blocking certain email addresses