You are here

function linkit_field_insert_pluing_validate in Linkit 7.2

Validation callback; From The insert plugin field on fields.

Only validate this field if linkit is enabled on the instance.

1 string reference to 'linkit_field_insert_pluing_validate'
linkit_form_field_ui_field_edit_form_alter in ./linkit.field.inc
Implements hook_form_FIELD_UI_FIELD_EDIT_FORM_alter().

File

./linkit.field.inc, line 180
Implementation for Fields and Linkit.

Code

function linkit_field_insert_pluing_validate($element, &$form_state, $form) {
  if (isset($form_state['values']['instance']['settings']['linkit']['enable']) && $form_state['values']['instance']['settings']['linkit']['enable']) {
    if (empty($element['#value'])) {
      form_error($element, t('You must select an insert plugin.'));
    }
  }
}