Lastly, here's code that I quickly modified for yours.
I'm sure there's a few more things you can do to improve the quality.
NET 2.0 (C#) web form that contains a textbox for users to enter multiple e-mail addresses separated by semicolons.
We need to validate that each individual e-mail address entered is a valid e-mail address format.
We've added a Custom Validator to perform this validation.
We have the server-side validation working fine, but now we need to add some client-side validation via Java Script. Here's what we have so far: ID="Custom Validator To" runat="server" Client Validation Function="validate To" Control To Validate="Text Box To" Display="Dynamic" Error Message="Invalid e-mail address or addresses.
This means that we can either be too strict or too lenient with our regex.
Here is the code to validate email address in Java Script using regular expression.
The argument to this method is the email address you want to validate.
I've extended the single version for multiple by changing the regex to insist on one (valid) email, then allow optionally zero or more (valid) emails with a pre-prended ";".
I needed a simple email address validation in Java Script that caught obvious typos.I want to validate the E mail Address as soon as it is entered in a text box and the focus is changed to some other place in my web page.