It contains a form with one box that is checked for "email validity".
You can add in more form elements into the form, as you would with any other form.
On the final line we call test method for our regular expression and pass the email address as input.
//reported to validate incorrectly: [email protected] as true /[A-Z0-9._% -] @[A-Z0-9-] .
We can validate email address at client side and server side.
Description: A script that closely examines the content of a form box to ensure that the user entered a valid email address.
If not, the form submition is canceled, and the surfer prompted to re-enter a valid address.This is a code snippet for basic Java Script to validate email address using a regular expression.