DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Email validation using java script (http://www.daniweb.com/forums/thread78873.html)

vssp May 21st, 2007 1:44 am
Email validation using java script
 
Hi Friends

I need to validate the email address when submit the form using java script. When I enter one email address i have to val;idate the mail id. But at the same time I have entered multiple email address seprated by comma . I unable to validate

How can i validate the multiple email address when i click on the form .

Please advise

smalldog May 21st, 2007 4:25 am
Re: Email validation using java script
 
Hi VSSP, use something like this ;)

<script>
function Validate(id) {
var list=document.getElementById(id).value.split(',');
for (y=0; y<list.length; y++)
alert('Validate this email:'+list[y]);
}
</script>

<input type="text" name="email" id="email" value="mail@mail.com,mail@mail.net">
<input type="button" value="Validate" onclick="Validate('email');">

vssp May 21st, 2007 11:39 pm
Re: Email validation using java script
 
Thanks
Its working

Thanks for your reply


All times are GMT -4. The time now is 10:21 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC