You are here

function phonefield_field_settings_form_validate in Phone Field 7

Form validate.

#element_validate handler for phonefield_field_instance_settings_form().

1 string reference to 'phonefield_field_settings_form_validate'
phonefield_field_instance_settings_form in ./phonefield.module
Implements hook_field_instance_settings_form().

File

./phonefield.module, line 160
Hooks for a module that defines a simple phone number field type.

Code

function phonefield_field_settings_form_validate($element, &$form_state, $complete_form) {
  if ($form_state['values']['instance']['settings']['linkstate'] === 'static' && empty($form_state['values']['instance']['settings']['linkvalue'])) {
    form_set_error('instance][settings][linkvalue', t('A link label must be provided if the link label is a static value.'));
  }
}