Categories:

Home / Free JavaScripts / Forms / Here

Cut & Paste Double-enter form field script

Credit: Jon Caws w/ modifications by JavaScript Kit

Description: You've probably encountered forms where you're asked to double-enter a field, such as the email or password field. This provides confirmation on the accuracy of the input. Well, use this script to add such a functionality to your forms. It cross checks any two fields to ensure they are:

1) Not blank
2) More importantly, that the two inputs are identical.

If either of the above conditions are not met, an alert message prompts up, and the submission process is halted.

Example:

Enter email:      
Re-Enter email:

Directions: Simply add the below to the BODY section of your page:

As illustrated inside the source code, add the code:

<form onSubmit="return verify(this.emailone, this.emailtwo)">

inside your form tag to associate the two fields named "emailone" and "emailtwo" so the later is a double-check of the former.


JavaScript Tools:
Site Info

CopyRight 1998-2014 JavaScript Kit. NO PART may be reproduced without author's permission.