You are here

function hubspot_admin_settings_validate in HubSpot 7.2

Same name and namespace in other branches
  1. 6.2 hubspot.admin.inc \hubspot_admin_settings_validate()
  2. 6 hubspot.admin.inc \hubspot_admin_settings_validate()
  3. 7.3 hubspot.admin.inc \hubspot_admin_settings_validate()
  4. 7 hubspot.admin.inc \hubspot_admin_settings_validate()

Form validation handler for hubspot_admin_settings().

Ensures that the debug email address provided is valid if debugging is enabled.

File

./hubspot.admin.inc, line 112
Provides admin settings page to adjust HubSpot API key, debugging settings, JavaScript embedding, and form submission settings.

Code

function hubspot_admin_settings_validate($form, &$form_state) {
  if ($form_state['values']['hubspot_debug_on'] && !valid_email_address($form_state['values']['hubspot_debug_email'])) {
    form_set_error('hubspot_debug_email', t('You must provide a valid email address.'));
  }
}