Verify/Validate Email Address on Form

Highlighted
Anonymous
Not applicable

Verify/Validate Email Address on Form

It's a fairly common practice to have an "Email" field on your form as well as a "Confirm/Verify Your Email" to ensure that there won't be the chance to enter an email address erroneously.  Is there a way to do this in Marketo?  I can't imagine I'm the first person to ask about this...

Tony
Tags (1)
5 REPLIES 5
Highlighted
Anonymous
Not applicable

Re: Verify/Validate Email Address on Form

A very small JavaScript/jQuery can compare the two input fields.

It can be added as custom forlm validation.

 
<script type="text/javascript"> 
function checkEmail(email1,email2) { 
   var e1 = document.getElementById('email1').value; 
   var e2 = document.getElementById('email2').value; 

   if (e1 != e2) { 
      return true; 
   } 
   else 
   { 
     alert('Plerase verify the email address!'); 
    return false; 
   } 
</script> 
 
 
and set the additional attribute of the submit button to
Code:
onclick=" return checkEmail('email1','email2');"


Adding custom validation to a Marketo form before submitting it
 

Highlighted

Re: Verify/Validate Email Address on Form

The above link to the Marketo resource page doesn't work. Correct link is: Adding custom validation to a Marketo form before submitting it

But be warned, the information in that help article appears to be incorrect as well.

And I agree with the original post - having a Confirm Email Address functionality is pretty standard stuff, and should work out of the box in Marketo.

Highlighted
Anonymous
Not applicable

Re: Verify/Validate Email Address on Form

Does this method require two email address fields? i.e. create another field in Marketo admin?

Thanks
Highlighted
Anonymous
Not applicable

Re: Verify/Validate Email Address on Form

Alison

Yes this method requires a second field for the Verify / Confirm email address. As this is not a standard field you would need to create it under Administration.
Highlighted
Anonymous
Not applicable

Re: Verify/Validate Email Address on Form

How do you set the attibute of the submit button?

onclick=" return checkEmail('email1','email2');"