H I O X INDIA
FREE Javascript
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch Portuguese Japanese தமிழ்
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java Script Source
List All
Date & Time
Calendar
Stop Watch script
Slide Show
Ad Display
Animated Image Effects
Image Effect
Mouse Effects
Color Picker Tool
Dynamic Color
Random Generator
Select All
Form Validation
Formatting Forms
Textbox Counter
Dynamic Form select
Bookmark
Window / User Info
Pagination
Security / Authenticate
Status Bar
Title Bar
Cursor Position
Country List
Calculators
Delete Repeated Values
Alphanumeric
Free Games





Multi E-mail Validation Script


About
This script will help you to validate numerous email id's entered in a form field.


Features
a)You can validate multiple email's entered in textfield using this javascript function.
b)Simple and ease of use.
c)Just copy the code in to your page and use it.

Preview
Give one mailid per line.



Code
<!-- Script by hscripts.com -->
<script type="text/javascript">
function checkMailId(mailids)
{
var arr = new Array(
'.com','.net','.org','.biz','.coop','.info','.museum','.name','.pro',
'.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag','.ai','.al',
'.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw','.az','.ba','.bb',
'.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm','.bn','.bo','.br','.bs',
'.bt','.bv','.bw','.by','.bz','.ca','.cc','.cd','.cf','.cg','.ch','.ci',
'.ck','.cl','.cm','.cn','.co','.cr','.cu','.cv','.cx','.cy','.cz','.de',
'.dj','.dk','.dm','.do','.dz','.ec','.ee','.eg','.eh','.er','.es','.et',
'.fi','.fj','.fk','.fm','.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh',
'.gi','.gl','.gm','.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy',
'.hk','.hm','.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io',
'.iq','.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li','.lk',
'.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg','.mh','.mk',
'.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt','.mu','.mv','.mw',
'.mx','.my','.mz','.na','.nc','.ne','.nf','.ng','.ni','.nl','.no','.np',
'.nr','.nu','.nz','.om','.pa','.pe','.pf','.pg','.ph','.pk','.pl','.pm',
'.pn','.pr','.ps','.pt','.pw','.py','.qa','.re','.ro','.rw','.ru','.sa',
'.sb','.sc','.sd','.se','.sg','.sh','.si','.sj','.sk','.sl','.sm','.sn',
'.so','.sr','.st','.sv','.sy','.sz','.tc','.td','.tf','.tg','.th','.tj',
'.tk','.tm','.tn','.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug',
'.uk','.um','.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu',
'.ws','.wf','.ye','.yt','.yu','.za','.zm','.zw');

var sd = mailids;
var ids = sd.split("\n");
var val = true;

for(var j=0; j<ids.length; j++)
{
	var mai = ids[j];
	var dot = mai.lastIndexOf(".");
	var ext = mai.substring(dot,mai.length);
	var at = mai.indexOf("@");
	var dom = dot - at;
        var sp = mai.indexOf(" ");
	if(dom >= 4 && at > 1 && sp == -1)
	{
		for(var i=0; i<arr.length; i++)
		{
			if(ext == arr[i])
			{
			val = true;
			break;
			}
			else
			{
			val = false;
			}
		}
		if(val == false)
		{
			alert("Your maild "+mai+" is not corrrrect");
			return false;
		}
	}
	else
	{
	 alert("Your maild "+mai+" is not correct");
	 return false;
	}
}

return true;
}
</script>
<!-- Script by hscripts.com -->

Release Date - 08-08-2004

Usage
Here we have explained with a form
a)Creating the form
<form name="test" onSubmit="return checkMailId(test.mailf.value)">
Give one mailid per line.<br>
<textarea name=mailf type=text rows=5 cols=15></textarea><br>
<input type=submit value=test>
</form>

b)Copy the code in to your page.
c)Things will work. The importent portion is the onSubmit call in the form. "onSubmit = return checkMailId(test.mailf.value)".We call the method checkMaiId with the form fields value as the variable.
d)If the mailid check is true form action willl take place, else alert will be done.


License
- This javascript (misspelled as java script)/HTML code is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- Detailed License information can be found here
- You can purchase the script if your requirements does not meet GPL License terms.


privacy policy     license     sitemap
© 2004-2010 HIOX INDIA

Others