You are here

function date_tools_change_type_form_validate in Date 7

Same name and namespace in other branches
  1. 8 date_tools/date_tools.change_type.inc \date_tools_change_type_form_validate()
  2. 6.2 date_tools/date_tools.change_type.inc \date_tools_change_type_form_validate()
  3. 7.3 date_tools/date_tools.change_type.inc \date_tools_change_type_form_validate()
  4. 7.2 date_tools/date_tools.change_type.inc \date_tools_change_type_form_validate()

File

date_tools/date_tools.change_type.inc, line 50

Code

function date_tools_change_type_form_validate($form, &$form_state) {
  $field_name = $form_state['values']['date_field'];
  $new_type = $form_state['values']['type'];
  $field = content_fields($field_name);
  $old_type = $field['type'];
  if ($new_type == $old_type) {
    form_set_error('type', t('The current type is the same as the chosen type. There is nothing to change.'));
  }
}