You are here

function soundcloudfield_settings_form_validate in SoundCloud field 7

Validate the field settings form.

1 string reference to 'soundcloudfield_settings_form_validate'
soundcloudfield_field_instance_settings_form in ./soundcloudfield.module
Implements hook_field_settings_form().

File

./soundcloudfield.module, line 188
@author Attila Fekete - http://drupal.org/user/762986

Code

function soundcloudfield_settings_form_validate($element, &$form_state, $complete_form) {

  // Validate width.
  $width = $form_state['values']['instance']['settings']['soundcloudplayer']['width'];
  if (!empty($width) && ($width < 1 || $width > 100)) {
    form_set_error('instance][settings][soundcloudplayer][width', t('Player width must be a positive integer between 1-100'));
  }
}