Hello,
This is a feature request for the ability to control which fields are required on the Constant Contact Sign Up form. It would be ideal to change these settings via the admin form at: admin/config/services/constant_contact/settings
At the moment, it appears that any additional fields that are enabled (such as First Name, Last Name, Company Name, etc) are set to be required by default. In our case, we need these additional fields to be optional.
As a quick fix, I modified the default field requirement value in constant_contact.module. This is hard coded in constant_contact.module on line 1011. (See my MOD comment below)
if($field != '_email_'.$delta):
$fieldname = str_replace(' ','', $field);
$form["cc_{$fieldname}_{$delta}"] = array(
'#type' => 'textfield',
'#title' => $field,
'#size' => 30,
'#required' => false, /* MOD: changed true to false here to NOT require custom fields by default */
'#default_value' => (isset($form_state['input']["cc_{$fieldname}_{$delta}"])) ? $form_state['input']["cc_{$fieldname}_{$delta}"] : '',
);
endif;
Thank you.
-Dave
~~~~~~~~~~~~~~~~~~~~~~
Dave Sawyer
Metaface Development
Comments
Comment #1
justphp commentedThis can be added.
if you use webform module we have a new component available which might be useful in the meantime.
Comment #2
jstollerI would very much like to see this feature added to the 6.x branch as well. Should I add a separate issue for that?
In my case, I want to allow users to enter their company name, but not everybody is representing a company, so that field should be optional.
Comment #3
justphp commentedShould not be a problem, code for this has not changed between the releases so will be simple copy / paste when it's been added to one version.
Comment #4
jmickelaIs this separate from the Webform Constant Contact Component module? Because there isn't a Drupal 7 release of that.
Comment #5
hejeva commentedI would like to see the option where the extra fields you can set in the block are required or not. I have 2 fields that I want required and 1 extra field to not be required.
Comment #6
ThaiGringo commentedThanks for illustrating the place in the code for hardcoding mods.