It would be nice to have the possibility to add some custom fields to the feedback form. Like for example: Website address, Msn address, Age, Location, and so on...

Comments

rediguana’s picture

Version: 4.6.x-1.x-dev » 4.7.x-1.x-dev

I agree, this would be very useful to us to be able to implement a membership form for an incorporated Society so that the details are emailed to the Secretary upon completion.

An intermediate step may be to to prepopulate the body field with text that the user can type around.

kbahey’s picture

Status: Active » Closed (won't fix)

The functionality of having custom fields exist already in other modules, e.g. webform.

So, closing this.

rediguana’s picture

I managed to hack the code to insert text into the textarea for the body of the email.

Look for

   if ($page->field_body) {
      $form['body'] = array(
        '#type' => 'textarea',
        '#title' => t('Message'),
        '#cols' => 60,
        '#rows' => 15,
        '#description' => NULL,
        '#attributes' => NULL,
        '#required' => TRUE,
      );
    }

and replace it with

$prefilled_text = '';
    if ($page->title == 'Feedback form name goes here') {
    	$prefilled_text = "Prefilled text content goes here";
    }
    if ($page->field_body) {
      $form['body'] = array(
        '#type' => 'textarea',
        '#title' => t('Message'),
        '#cols' => 60,
        '#rows' => 15,
        '#description' => NULL,
        '#attributes' => NULL,
        '#required' => TRUE,
        '#default_value' => $prefilled_text,
      );
    }

Does the job wonderfully!

rediguana’s picture

Thanks for the pointer to webform also!