You are here

function videojs_field_formatter_settings_form_validate in Video.js (HTML5 Video Player) 7.2

Same name and namespace in other branches
  1. 7.3 videojs.module \videojs_field_formatter_settings_form_validate()
1 string reference to 'videojs_field_formatter_settings_form_validate'
videojs_field_formatter_settings_form in ./videojs.module
Implements hook_field_formatter_settings_form().

File

./videojs.module, line 260
Provides an HTML5-compatible with Flash-fallback video player.

Code

function videojs_field_formatter_settings_form_validate($form, $form_state) {
  $width = $form['width']['#value'];
  $height = $form['height']['#value'];

  // The fields need to be both entered or both empty
  if (empty($width) != empty($height)) {
    form_error($form[empty($width) ? 'height' : 'width'], t('The width and height field need to be both set or both empty.'));
  }
}