Jump to content

Multiple Email Id Validation Script


subha rr

Recommended Posts

Hi...........Is there any javascript for validating multiple email id's ....Pls help me...regards subha
Hi------2 :)Before you asking for help to somebody else please explain first what you have done or tried.I am glad to help you if I know what your specific problem is.
Link to comment
Share on other sites

This is the script i am using for validation of single email id

<script language="javascript">function aa(valid) {if (/^\w+([\.-]?\w+)*@(\w{3})+([\.-]?\w+)*(\.\w{2,6})+$/.test(valid.email.value)){return (true)}alert("Email Id is not valid");return (false)}</script>
how to write javascript for validating multiple email id's ....Pls help meregardssubha
Link to comment
Share on other sites

  • 4 weeks later...

Off the cuff something like this or similar would work, you could probably go deeper regex but probably with no better result, regex is better at finding one or more concrete things, than finding mistakes because mistakes are infinite (take my code for example :) ).

<script language="javascript">function aa(valid) {var emailArray;emailArray = valid.email.value.split(",")for(var i = 0; i < emailArray.length; i++){   if (/\w+([\.-]?\w+)*@(\w{3})+([\.-]?\w+)*(\.\w{2,6})+$/.test(emailArray[i].trim))   {	     }   else   {	  alert("Email Id is not valid");	  return (false)   }}return true}</script>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...