You are here

function ad_select_adtype in Advertisement 6.3

Same name and namespace in other branches
  1. 6.2 ad.module \ad_select_adtype()
  2. 7 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 714

Code

function ad_select_adtype(&$form, &$form_state) {
  if (!$form_state['values']['adtype'] && !$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;
  }
}