Home / Free JavaScripts / Email and Email Validation / Here

Cut & Paste Manual Email check

Credit: JavaScript Kit

Description: Often times in a form, the single most important field is the email address field. If a user inadvertently enters an incorrect address, the method of contact between you and the user is cut off. Here's a script that forces the user to double check whether a valid email is entered before submitting the form. It alerts a box with the entered address upon form submission, and asks the user whether this information is correct or not. Crude yet highly effective way to enforce a valid email entry!



Step 1: Cut and paste the below script into the <head> section of your page:

Having done the above, you now need to make two simple alterations to your form, so the email field is connected to the script, and manual checking is enabled.

Step 2: Inside the text box that holds the email address, give it a name using the "name" attribute (ie: useremail). For example:

<input type="text" value="Enter your email here!" name="useremail">

Step 3: Finally, add the below onSubmit event handler into the <form> tag itself:

<form onSubmit="return alertemail(useremail)">
<input type="text" value="Enter your email here!" name="useremail">

Note that the name value specified in step 2 ("useremail") is used also as the parameter inside onSubmit.

You're done!

JavaScript Tools:
Site Info

CopyRight (c) 2015 JavaScript Kit. NO PART may be reproduced without author's permission. Contact Info