Community & Support

Re-Enter Email Address For Verification In Contact Form

I would like a user to re-type his or her email address into my contact form to ensure validity, as I have had issues with prospective customers mistyping their email address many times in the past. Drupal by default does not ask a user to re-enter the email address as part of the contact form, so I am wondering if anyone is aware of a module or method where I can add this functionality to Drupal?

Thanks in advance for any assistance you can provide!

Comments

It's not exactly what you are

It's not exactly what you are asking but http://drupal.org/project/email_verify might help.

Another option might be to

Another option might be to use webform module to define your own custom contact form with 2 email fields, then either "use PHP for additional processing" (this is a webform permission) and on the webform Edit screen under webform advanced settings enter some PHP code under "Additional Validation:" to compare the value of the 2 fields and set an error if they don't match, or, if you are not feeling in the mood for PHP ;) you might be able to do similar with Rules + Rules Forms which may well let you compare 2 fields as a validation step (but defined via the UI rather than in PHP code) .. however, be warned that Rules takes a little getting used to though it is immensely powerful.

create two email fields i

create two email fields
i called mine
email
email_1

In advanced validation section add

<?php
 
if ($form_values['submitted_tree']['email'] != $form_values['submitted_tree']['email_1']) {
   
form_set_error('submitted][email', t('E-mail addresses must match.'));
  }
?>

example at http://www.angcomleisure.com/active-card-booking-registration