Skip navigation

Currently Being Moderated

Adding an email verification field to a web form

Mar 26, 2012 4:58 PM

You can update a web form to require that visitors enter their email address twice, to verify it. This is similar to password verification, because the logic added to the form compares both fields to ensure they match. Open the the page the web form is and paste the following code just below the email address field:

 

 

<input id="EmailAddress2" class="cat_textbox" name="EmailAddress2" maxlength="255"/>

 

Then you can embed the following JavaScript code into the existing JavaScript code that vlidates the web form:

 

<script type="text/javascript">
var submitcount77199 = 0;
function checkWholeForm77199(theForm){

// The above code is your existing validation code. The numbers will be different in your case

// This is the code you add to it:

     if (document.getElementById('EmailAddress').value !=document.getElementById('EmailAddress2').value) 
     {
     alert('- Email address and its confirmation do not match\n');
     return false;
     }
}
</script>
 
Comments (2)