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

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');">

Thanks
Its working

Thanks for your reply

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.