You are here

function autocomplete_deluxe_validate_multiple in Autocomplete Deluxe 7.2

Validation callback for "multiple" mode.

1 string reference to 'autocomplete_deluxe_validate_multiple'
autocomplete_deluxe_element_process in ./autocomplete_deluxe.module
Generates the basic form elements and javascript settings.

File

./autocomplete_deluxe.module, line 405
Define enhanced autocomplete wdiget.

Code

function autocomplete_deluxe_validate_multiple($element, &$form_state) {
  if (isset($element['#required']) && $element['#required']) {
    $tags = autocomplete_deluxe_extract_tags($element['#value']);
    if (!$tags) {
      form_error($element['#parent_element'], t('!name field is required.', array(
        '!name' => $element['#parent_element']['#title'],
      )));
    }
  }
}