Jump to content

Multiple Email Id Validation Script


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...