You are here

function styleguide_palette_form_validate in Style Guide 7

Form validation handler for styleguide_palette_form().

See also

styleguide_palette_form_submit()

File

styleguide_palette/styleguide_palette.admin.inc, line 141
Administrative page callbacks for the Style Guide Swatch module.

Code

function styleguide_palette_form_validate($form, &$form_state) {
  if (!empty($form_state['values']['name']) && empty($form_state['values']['hex'])) {
    form_error($form['add_swatch']['hex'], t('Missing swatch hex value.'));
  }
  if (empty($form_state['values']['name']) && !empty($form_state['values']['hex'])) {
    form_error($form['add_swatch']['name'], t('Missing swatch name.'));
  }
}