Add Extra Fields in Drupal Contact Form

First Drupal Module!

This module will give you extra fields integrated into your drupal sitewide contact form, and include it into your email, configurable from Drupal Administration.

There are two options for adding a phone number. The first is a required field, which is added just below where the user enters there email. The second, gives 2 check boxes, in response to how they would like to be responded to (email or phone), and if they check reply via phone, a new text input slides down with jQuery for the user the place the phone number into. This was the original idea, and purpose of this whole project, since I found what I believe was a Wordpress plugin that did something very similar on another website, and decided to replicate it into Drupal.

A third option, allows you to choose a title, and add an additional text field. It has been defaulted to 'Company Name' as I couldn't seem to think of anything else at the time.

  • Working demo here
  • Download it here (Drupal 6)

If you would like any additional changes or extra options, let me know, and ill get back to you!

Comments

Contribute in Drupal Website

i think is good that you upload and share this module in drupal website

Perfect!

Exactly what I was looking for - just to be clear, to configure the extra fields, you must go to Site Building > Contact Form > Extra Contact Fields.

Gratefully,

Russ

Change Order

Hi what a great Hack. I added some additional fields, but how does new fields appear under the contact form description?

New fields are above the Subject :(

If you want the extra

If you want the extra inserted fields below the title, search for the following code in the contactextra.module file on line 44.

// check for insertion point and add new form element
      if ($key == 'subject') {

and replace 'subject' with 'message'. Or replace with any current fields with the input name value.

As for placing under the message, im not quite sure. I'll probally redo this, if anyone is interested, when Drupal 7 comes out, with alot more options and flexibility, and upload it onto the drupal website.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Image CAPTCHA
Enter the characters (without spaces) shown in the image.