You are here

function pardot_admin_campaign_validate in Pardot Integration 7

Same name and namespace in other branches
  1. 6 pardot.admin-campaign.inc \pardot_admin_campaign_validate()
  2. 7.2 pardot.admin-campaign.inc \pardot_admin_campaign_validate()

Form validation handler for pardot_admin_campaign().

See also

pardot_admin_campaign_submit()

File

./pardot.admin-campaign.inc, line 74
Admin campaign form.

Code

function pardot_admin_campaign_validate($form, $form_state) {
  if (db_query("SELECT campaign_id FROM {pardot_campaign} WHERE campaign_id = :campaign_id", array(
    ':campaign_id' => $form_state['values']['campaign_id'],
  ))
    ->fetchField()) {
    form_set_error('campaign_id', t('Your Campaign ID much be unique'));
  }
}