You are here

function ad_select_adtype in Advertisement 7

Same name and namespace in other branches
  1. 6.3 ad.module \ad_select_adtype()
  2. 6.2 ad.module \ad_select_adtype()

Ad type switch submit handler.

1 string reference to 'ad_select_adtype'
ad_form in ./ad.module
Implementation of hook_form().

File

./ad.module, line 856

Code

function ad_select_adtype(&$form, &$form_state) {
  if (!isset($form_state['values']['adtype']) && !isset($form_state['values']['adtype_select'])) {
    form_set_error('adtype_select', t('Please, select an Ad type.'));
  }
  if (!isset($form_state['values']['adtype']) || isset($form_state['values']['adtype_select']) && $form_state['values']['adtype'] != $form_state['values']['adtype_select']) {
    $form_state['values']['adtype'] = $form_state['values']['adtype_select'];
    $form_state['rebuild'] = TRUE;
  }
}