Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Coding Releases > Coding Snippets
You last visited: Today at 09:34

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



js - validate multiple emails

Discussion on js - validate multiple emails within the Coding Snippets forum part of the Coding Releases category.

Reply
 
Old   #1

 
Ravenstorm's Avatar
 
elite*gold: 0
The Black Market: 100/0/0
Join Date: Jan 2010
Posts: 13,150
Received Thanks: 3,207
[JS] Validierung mehrerer Emails

Hier ein kleines Code-Schnipsel um ein oder mehrere E-Mail-Adressen zu Validieren.

Bsp. für gültige Adressen:
Code:

, 
usw
Bsp. für ungültige Adressen:
Aufruf:
PHP Code:
validateMultipleEmails(value,","); 
Code für die Validierung pro Email:
PHP Code:
function validateEmail(email) { 
        var 
regex = /^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/;
    return 
regex.test(email);
    } 
Code für die Validierung der Value:
PHP Code:
function validateMultipleEmails(valueseperator) {
    if (
value != '') {
        if(
value.indexOf(seperator " ") !== -1){
            var 
result value.split(seperator " ");
        }else{
            var 
result value.split(seperator);
        }

        for (var 
0result.lengthi++) {
            if (
result[i] != '') {
                if (!
validateEmail(result[i])) {
                   return 
false;
                }
            }
        }
    }
    return 
true;
    } 
Ravenstorm is offline  
Old 12/02/2013, 19:31   #2
 
Frosttall's Avatar
 
elite*gold: 55
Join Date: Oct 2009
Posts: 5,471
Received Thanks: 1,479
ist ebenso eine erlaubte Email-Adresse
Frosttall is offline  
Old 12/02/2013, 23:48   #3

 
Ravenstorm's Avatar
 
elite*gold: 0
The Black Market: 100/0/0
Join Date: Jan 2010
Posts: 13,150
Received Thanks: 3,207
Quote:
Originally Posted by Frosttall View Post
ist ebenso eine erlaubte Email-Adresse
Sonst noch welche Sonderformen? Dann würde ich die RegEx ergänzen.

Derzeit mal:

PHP Code:
function validateEmail(email) {  
        var 
regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/; 
    return 
regex.test(email); 
    } 
changed to

PHP Code:
function validateEmail(email) {  
        var 
regex = /^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/; 
    return 
regex.test(email); 
    } 
Ravenstorm is offline  
Reply


Similar Threads Similar Threads
.: Günstige emails :. l .:Arcor Mails Perfekt zum Botten :. l .:Günstige emails :.
09/23/2013 - elite*gold Trading - 2 Replies
-
[Selling] WOW account multiple 90's, SC2 CE & Diablo 3 Multiple 60's
05/29/2013 - World of Warcraft Trading - 0 Replies
WTS WOW account multiple 90's, SC2 CE & Diablo 3 Multiple 60's Wow account has a 90 Worgen Druid and a 90 Panda Priest. Gear is nothing 2 notable, priest has season 12 set & a bunch of pve epix. There is also a 82 Tauren Paliden with heirlooms. Priest has Blood Guard title and there is a bunch of rare pets and mounts. Star craft 2 is the collectors edition with all the bonus avatars and watnot. Diablo 3 has a level 60 Monk (25), 60 Wizard (1) and a 60 Hunter (1). All pretty porley...
2 Questions, Selecting multiple coord & multiple inventory items
02/05/2013 - CO2 Private Server - 7 Replies
Need a hand with 2 things ive been tryin to work out but not had much luck so far. 1:Took this example from mining which sets the specific map, But how can you set multiple coords on the map so the action can only been done when standing in those coords rather then the entire map? switch (client.Entity.MapID) { case 1002: {
Unable to validate game version
05/29/2007 - World of Warcraft - 1 Replies
Hi I downloaded WOW from torrent site and installed all the patches to 2.1.0 Now i'm using wowstatus.net to find private servers to play on, but when i click on "Connect" and it loade wow and i try to login, i get "Unable to validate game version.. This may be caused by.... Please visit ...." error... Do i need some kind of no cd crack or something? I tried a few servers but i always get this.. Did i forgot to do sometbing before i can play?



All times are GMT +2. The time now is 09:34.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.