subha rr Posted February 4, 2009 Share Posted February 4, 2009 Hi...........Is there any javascript for validating multiple email id's ....Pls help me...regards subha Link to comment Share on other sites More sharing options...
Guest br3ak Posted February 4, 2009 Share Posted February 4, 2009 Hi...........Is there any javascript for validating multiple email id's ....Pls help me...regards subhaHi------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 More sharing options...
subha rr Posted February 4, 2009 Author Share Posted February 4, 2009 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 More sharing options...
justsomeguy Posted February 4, 2009 Share Posted February 4, 2009 How are the emails separated? Link to comment Share on other sites More sharing options...
subha rr Posted February 28, 2009 Author Share Posted February 28, 2009 How are the emails separated?Hi...Multiple email ids seperated by commas..........Regardssubha Link to comment Share on other sites More sharing options...
Technage Posted February 28, 2009 Share Posted February 28, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.